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

ÀH®É·s¼WÄæ¦ì°ÝÃD

ÀH®É·s¼WÄæ¦ì°ÝÃD

·Q½Ð°Ý¦U¦ì°ª¤â­Ì


¤p§Ì¤µ¤Ñ¤À§O¦bA1 B1 C1 D1 E1 F1 Äæ¦ì ¤À§O¥´¤W¤F¨C­Ó¤ëªº²Ä¤@¤Ñ

¤]´N¬O¤@¤ë¤@¤é ¦Ü ¤»¤ë¤@¤é

¤p§Ì·Q»s§@¤@­Ó¿é¤J¼Æ¦r¨Ã¥B«ö¤U«ö¶s«á  ´N¯à°÷¥H¿é¤Jªº¼Æ¦r¨Ó¤À³Î¥X«e­±´X­Ó¤ë ¨C¶gªº¬P´Á¤é

¥Î»¡ªº¥i¯à«ÜÃø²z¸Ñ Á|¨Ò¤@¤U

        A       B      C       D        E      F
1     1/1   2/1   3/1   4/1    5/1   6/1

°²³]¤µ¤Ñ¿é¤J¼Æ¦r :  2
¥Nªí«e­±¨â­Ó¤ë³£¥²¶·Åã¥Ü¥X¤@¤ë¤Î¤G¤ëªº¨C­Ó¬P´Á¤é ¤é´Á
¥H2012¦~¨Ó»¡
´NÅܦ¨³o¼Ë
        A         B       C          D           E           F         G        H          I           J         K         L        M       N      
1    1/1    1/8     1/15    1/22     1/29     2/1     2/4     2/11    2/18   2/25    3/1     4/1     5/1    6/1

¥H¦¹Ãþ±À
­Y¿é¤Jªº¼Æ¦r¬O3  ¨º´NÅã¥Ü¥X«e­±¤T­Ó¤ë¨C­Ó¤ëªº¬P´Á¤éªº¤é´Á

·Q½Ð°Ý¦U¦ì°ª¤â  ¥Ñ©ó¿é¤Jªº¼Æ¦r¤£¤@©w  ¨C¦~¨C¶gªº¬P´Á¤é¤]³£¤£¦P
½Ð±Ð¸Ó¦p¦ó¼g¥X¥¨¶°>"< §xÂZ«Ü¤[¤F ÁٽЦU¦ì¸Ñµª!!!!
WOW

¦^´_ 13# hugh0620
°ò¥»¤W¼Ó¥Dªº°ÝÃD¦³¤@¨Ç¤£²M·¡
¬O­n¿é¤J³B²z´X­Ó¤ë¡AµM«á¶i¦æÄæ¦ì­«½sªº¸Ü¡Aµ{¦¡À³¥i¦æ
­Y¬O«ü©w¨º¨Ç¤ë¥÷¡A¨º´N­n¿é¤J2­Ó°Ñ¼Æ¡A°_©l¤ë¥÷¤Î³B²z¤ë¼Æ©Îµ²§ô¤ë¥÷
©Ò¥H¡A³o¥u¬O´£¨Ñ¥t¤@ºØ«ä¸ô°Ñ¦Ò¡A¦Ü©ó¦p¦ó²Å¦X­Ó¤H»Ý¨D¡AÁÙ¬O­n¦Û¤v°Ê¸£
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 12# Hsieh


    H¤j¤j~ ¤p§Ì¦³´ú¸Õ¹L±zªºµ{¦¡½X~
    ­Y¹³¼Ó¥D¦³¸ó¦~«×ªº±¡ªp~
    ex. ­Y¸ê®Æ±q20120101~20131201ªº¸Ü~
    ¿é¤J2¤ë¥÷
    µ{¦¡½X¶È·|§ì¨ú 201201~201202ªº¸ê®Æ³B²z~
    ¦]¬°µ{¦¡½X¨Ã¥¼°w¹ï±q­þ¤@­Ó¦~¤ëªº¸ê®Æ¨Ó³B²z~
    ¦Ó¬O¶È³B²z²Ä¤@­Ó§ì¨úªº¤ë¥÷~
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 1# g93353
  1. Sub Ex()
  2. Dim k%, Ar(), j%, s%, ky, d As Object
  3. k = InputBox("¿é¤J¤ë¼Æ", , 3)
  4. Set d = CreateObject("Scripting.Dictionary")
  5. For Each A In Rows(1).SpecialCells(xlCellTypeConstants)
  6.    d(Format(A, "yyyy/mm")) = DateValue(Format(A, "yyyy/mm/1"))
  7. Next
  8. For Each ky In d.keys
  9. j = j + 1
  10. If j <= k Then
  11.    For i = d(ky) To DateAdd("M", 1, d(ky)) - 1
  12.    If (Day(i) = 1 Or Weekday(i, vbMonday) = 7) Then
  13.       ReDim Preserve Ar(s)
  14.       Ar(s) = i
  15.       s = s + 1
  16.    End If
  17.    Next
  18. Else
  19.       ReDim Preserve Ar(s)
  20.       Ar(s) = d(ky)
  21.       s = s + 1
  22. End If
  23. Next
  24. Rows(1) = ""
  25. [A1].Resize(, s) = Ar
  26. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 10# g93353
  1. Sub YY()
  2. Rows("2") = ""
  3. MX = InputBox("½Ð¿é¤J¤ë¥÷¼Æ")
  4. For M = 1 To MX
  5.   If [A2] = "" Then
  6.      [A2] = Cells(1, M)
  7.   Else
  8.      [IV2].End(xlToLeft).Offset(0, 1) = Cells(1, M)
  9.   End If
  10.   First = Cells(1, M) + (7 - Weekday(Cells(1, M), 2))
  11.   If [IV2].End(xlToLeft) <> First Then
  12.      [IV2].End(xlToLeft).Offset(0, 1) = First
  13.   End If
  14.   Do While Month(First + 7) = Month(Cells(1, M))
  15.      [IV2].End(xlToLeft).Offset(0, 1) = First + 7
  16.      First = First + 7
  17.   Loop
  18. Next M
  19. If MX <> 6 Then
  20.    Cells(1, MX + 1).Resize(1, 6 - MX).Copy [IV2].End(xlToLeft).Offset(0, 1)
  21. End If
  22. Range([A2], [IV2].End(xlToLeft)).NumberFormatLocal = "m/d;@"
  23. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ g93353 ©ó 2012-3-2 16:01 ½s¿è

ÁÂÁÂregister313  
±z¸ò hugh0620 ¤j¤j¼gªk³£¬O¿é¤J¦~¤ë¥÷«á·|¦Û°Ê¶]¥X
¤p§Ì¤w¸g¤À§O§â¨C­Ó¤ë1¸¹³£¦U§O¼g¦bA1 ¨ì F1(°²³]¬O1¨ì6¤ë)
¦Ó¿é¤Jªº¼Æ¦r¬O«ü«e­±(¼Æ¦r)­Ó¤ë³£¥²¶·Åã¥Ü¥X¬P´Á¤é(±q¨C­Ó¤ëªº1¸¹«á­±¨Ì§ÇÅã¥Ü¥X)
¤j¤j­Ìªº§@ªk³£³¡¤£·|¦³·s¼WÄæ¦ìªº°ÝÃD
¤p§Ì¤w¥ý±N¨C­Ó¤ëªº²Ä¤@¤Ñ¥ý¥´¦n
³o¼ËÄæ¦ìªº·s¼W´N·|¤£©T©w
©Ò¥H³Â·Ð¦A½Ð±Ð¦U¦ì¤F
¥ý«e±Ô­z¦³ÂIÁU½k  ¤£¦n·N«ä¤F>"<
WOW

TOP

¦^´_ 8# g93353
  1. Sub YY()
  2. Rows("2") = ""
  3. MX = InputBox("½Ð¿é¤J¤ë¥÷¼Æ")
  4. For M = 1 To MX
  5.   First = Cells(1, M) + (7 - Weekday(Cells(1, M), 2))
  6.   [A2].Offset(0, C) = First
  7.   C = C + 1
  8.   Do While Month(First + 7) = Month(Cells(1, M))
  9.      [A2].Offset(0, C) = First + 7
  10.      First = First + 7
  11.      C = C + 1
  12.   Loop
  13. Next M
  14. Cells(1, MX + 1).Resize(1, 6 - MX).Copy [A2].Offset(0, C)
  15. Range([A2], [IV2].End(xlToLeft)).NumberFormatLocal = "m/d;@"
  16. End Sub
½Æ»s¥N½X

TOP

ÁÂÁÂ register313 ¸ò hugh0620 ¤j¤j
·Q½Ð°Ý¤@¤U hugh0620 ¤j¤j

¤p§Ì¤w¸g¦Û¦æ§â¨C¤ëªº²Ä¤@¤Ñ³£¥ý¥´¦bÄæ¦ì¤W¤F(¦³¥i¯à¸ó¦~¥÷ EX : ±q2011 ¨ì2012)
¨º³o¼Ë¼gªk­n¦p¦ó§@­×§ï?
WOW

TOP

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2012-3-2 13:42 ½s¿è

¦^´_ 5# g93353

­Y¼Ó¥D±zªº¬O¸Ó¦~«×¾ã¦~¥÷ªº¸ê®Æ~  (¶È­­¤@­Ó¦~«×)
³o¼Ë¤U­±ªº¼gªk~ ¥i¥H±o¨ì§A»Ý­nªºµ²ªG~

­Y±z»Ý­nªº³]©w¬Y¤@­Ó°Ï¶¡ªº¸ê®Æ~ ¼gªk¤S¤£¤@¼Ë¤F~
case by case
  1. Sub EX()
  2. Dim B As Integer
  3. A = InputBox("½Ð¿é¤J¦~¥÷")
  4. B = InputBox("½Ð¿é¤J¤ë¥÷")

  5. If Len(A) = 4 And (Len(B) = 1 Or Len(B) = 2) Then
  6. A1 = DateValue(A & "¦~" & "1¤ë" & "1¤é")
  7. I = 0
  8. Sheet1.Rows("1:1").ClearContents
  9.     Do Until Month(A1 + I) > B
  10.        If Weekday(A1 + I, 2) = 7 Or (Month(A1 + I) = 1 And Day(A1 + I) = 1) Then
  11.           If Sheet1.Range("A1") = "" Then
  12.              Sheet1.Range("A1") = A1 + I
  13.           Else
  14.              Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A1 + I
  15.           End If
  16.        End If
  17.     I = I + 1
  18.     Loop
  19.     If B <> 12 Then
  20.        For I = B + 1 To 12
  21.        Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = DateValue(A & "¦~" & I & "¤ë" & "1¤é")
  22.     Next
  23.     End If
  24. End If

  25. End Sub
½Æ»s¥N½X
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¥»©«³Ì«á¥Ñ register313 ©ó 2012-3-2 15:10 ½s¿è
  1. Sub YY()
  2. Rows("2") = ""
  3. MX = InputBox("½Ð¿é¤J¤ë¥÷¼Æ")
  4. For M = 1 To MX
  5.   First = Cells(1, M) + (7 - Weekday(Cells(1, M), 2))
  6.   [A2].Offset(0, C) = First
  7.   C = C + 1
  8.   Do While Month(First + 7) = Month(Cells(1, M))
  9.      [A2].Offset(0, C) = First + 7
  10.      First = First + 7
  11.      C = C + 1
  12.   Loop
  13. Next M
  14. If MX <> 6 Then
  15.    Cells(1, MX + 1).Resize(1, 6 - MX).Copy [A2].Offset(0, C)
  16. End If
  17. Range([A2], [IV2].End(xlToLeft)).NumberFormatLocal = "m/d;@"
  18. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD