ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦Û°Ê±a¤J¤é´Á

[µo°Ý] ¦Û°Ê±a¤J¤é´Á

·Q¸ß°Ý°²³]§Ú¦³ 50µ§¸ê®Æ ©ñ¦bA¦C  
§Ú¦bB¦C­n¦Û°Ê±a¤J¤é´Á ±q¦¸¤ë1¸¹¨ì30¸¹©Î31¸¹ ~
³Ì«á31¸¹¸ê®Æ¶ñ¤J«áÄ~Äò±q1¸¹¶}©l¶ñ~

¦p:   A        B
        1     10/1
        2     10/2
        3     10/3
       .....     ......
       31    10/31
       32    10/1

¤j­P¤W·Q§e²{³o¼Ë ¤£ª¾¹D¦³¨S¦³¿ìªk¥ÎVBA¼g¥X¨Ó?!

¦^´_ 1# toromru


    Private Sub Worksheet_Change(ByVal Target As Range)
    zr = Target.Row: zc = Target.Column
    If zc = 1 And Cells(zr, 2) = "" Then
      Dim lad, sfd As Date
      sfd = Application.EoMonth(Date, -2) 'sfd means StartFromDate
      lad = Application.Max(Columns(2), sfd)  'lad means LastActionDate
      Cells(zr, 2) = lad + 1
  End If
  End Sub

TOP

¦^´_ 1# toromru
  1. Option Explicit

  2. Public Sub ex()
  3. Dim I As Date
  4. Dim r%, dN%, j%
  5. r = 1
  6. dN = DateSerial(Year(Date), Month(Date) + 2, 0) - DateSerial(Year(Date), Month(Date) + 1, 1) + 1 '­pºâ¦¸¤ë¦³´X¤Ñ
  7. For j = 1 To Cells(Rows.Count, 1).End(xlUp).Row Step dN '
  8.         For I = DateSerial(Year(Date), Month(Date) + 1, 1) To DateSerial(Year(Date), Month(Date) + 2, 0) '¶ñ¼g¤é´Á
  9.             If Cells(r, 1) <> "" Then '¹J¨ìAÄ榳ªÅ¥Õ¡A´N°±¤î
  10.                 Cells(r, 2) = Format(I, "m/ d")
  11.                 r = r + 1
  12.             End If
  13.         Next
  14. Next
  15. End Sub
½Æ»s¥N½X

TOP

Sub TTDATE()
Dim D As Date, DC%
D = DateSerial(Year(Date), Month(Date) + 2, 0)  '¤U¤ë©³
DC = Day(D) '¤U¤ë¤Ñ¼Æ
For i = 1 To [A65536].End(xlUp).Row
¡@¡@Cells(i, 2) = D - DC + 1 + (i - 1) Mod DC
Next i
End Sub

TOP

¦^´_ 4# ­ã´£³¡ªL


    ·PÁ±z ¥¿±`¨Ï¥Î¤¤ : )

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD