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

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

¦^´_ 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

¦^´_ 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

¦^´_ 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

¦^´_ 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

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD