- ©«¤l
- 559
- ¥DÃD
- 58
- ºëµØ
- 0
- ¿n¤À
- 626
- ÂI¦W
- 0
- §@·~¨t²Î
- win8
- ³nÅ骩¥»
- office2013
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TW
- µù¥U®É¶¡
- 2010-11-22
- ³Ì«áµn¿ý
- 2024-6-14
|
¦^´_ 3# g93353
¦³¦Aµy·L¬Ý¹L¼Ó¥Dn¨D~ ¦n¹³¬On§â¨C¤ëªº1¸¹±a¥X¨Ó~
¥i¨Ï¥Î¤U¦Cªº¤è¦¡~
Y¤£¥Î±a¥X¨C¤ë1¸¹ªº¸ê®Æ~ ´N±Ä¥Î¤W±²Ä¤@Ó¼Ò²Õ~- Sub EX()
- A = InputBox("½Ð¿é¤J¦~¥÷")
- B = InputBox("½Ð¿é¤J¤ë¥÷")
- If Len(A) = 4 And (Len(B) = 1 Or Len(B) = 2) Then
- A1 = DateValue(A & "¦~" & "1¤ë" & "1¤é")
- A2 = DateValue(A & "¦~" & "2¤ë" & "1¤é")
- A3 = DateValue(A & "¦~" & "3¤ë" & "1¤é")
- A4 = DateValue(A & "¦~" & "4¤ë" & "1¤é")
- A5 = DateValue(A & "¦~" & "5¤ë" & "1¤é")
- A6 = DateValue(A & "¦~" & "6¤ë" & "1¤é")
- I = 0
- Sheet1.Rows("1:1").ClearContents
- Select Case B
- Case 1
- Do Until Month(A1 + I) > 1
- If Weekday(A1 + I, 2) = 7 Or (Month(A1 + I) = 1 And Day(A1 + I) = 1) Then
- If Sheet1.Range("A1") = "" Then
- Sheet1.Range("A1") = A1 + I
- Else
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A1 + I
- End If
- End If
- I = I + 1
- Loop
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A2
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A3
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A4
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A5
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A6
- Case 2
- Do Until Month(A1 + I) > 2
- If Weekday(A1 + I, 2) = 7 Or (Month(A1 + I) = 2 And Day(A1 + I) = 1) Then
- If Sheet1.Range("A1") = "" Then
- Sheet1.Range("A1") = A1 + I
- Else
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A1 + I
- End If
- End If
- I = I + 1
- Loop
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A3
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A4
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A5
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A6
- Case 3
- Do Until Month(A1 + I) > 3
- If Weekday(A1 + I, 2) = 7 Or (Month(A1 + I) = 3 And Day(A1 + I) = 1) Then
- If Sheet1.Range("A1") = "" Then
- Sheet1.Range("A1") = A1 + I
- Else
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A1 + I
- End If
- End If
- I = I + 1
- Loop
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A4
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A5
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A6
- Case 4
- Do Until Month(A1 + I) > 4
- If Weekday(A1 + I, 2) = 7 Or (Month(A1 + I) = 4 And Day(A1 + I) = 1) Then
- If Sheet1.Range("A1") = "" Then
- Sheet1.Range("A1") = A1 + I
- Else
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A1 + I
- End If
- End If
- I = I + 1
- Loop
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A5
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A6
- Case 5
- Do Until Month(A1 + I) > 5
- If Weekday(A1 + I, 2) = 7 Or (Month(A1 + I) = 5 And Day(A1 + I) = 1) Then
- If Sheet1.Range("A1") = "" Then
- Sheet1.Range("A1") = A1 + I
- Else
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A1 + I
- End If
- End If
- I = I + 1
- Loop
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A6
- Case 6
- Do Until Month(A1 + I) > 6
- If Weekday(A1 + I, 2) = 7 Or (Month(A1 + I) = 6 And Day(A1 + I) = 1) Then
- If Sheet1.Range("A1") = "" Then
- Sheet1.Range("A1") = A1 + I
- Else
- Sheet1.Range("IV1").End(xlToLeft).Offset(0, 1) = A1 + I
- End If
- End If
- I = I + 1
- Loop
- End Select
- End If
- End Sub
½Æ»s¥N½X |
|