²Öp¥[Á`¼Æ¶q¤Î¨C¶g¥[Á`¼Æ¶q
- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¦^´_ 8# yen956
¤]¥i¥H¦p¦¹- Private Sub EX()
- Dim i As Integer, Rng As Range, MoDay As Date
- MoDay = DateSerial([n1], [q1], 1)
- With Range("C2:C4")
- .Resize(, 31) = ""
- With .Offset(3).Resize(, 31)
- .UnMerge
- .Rows("2:3") = ""
- End With
- i = 1
- Do While Month(MoDay + i - 1) = Month(MoDay) '¦P¤@¤ë¥÷
- .Cells(1, i) = MoDay + i - 1
- .Cells(2, i) = i
- .Cells(3, i) = Weekday(MoDay + (i - 1), 2)
- .Cells(5, i) = Application.Evaluate("Sum(" & .Cells(4, 1).Resize(, i).Address & ")")
- If .Cells(3, i) = 7 Or i = Day(DateAdd("M", 1, MoDay) - 1) Then '©Î¬O ¦¹¤ë¥÷³Ì«á¤@¤Ñ
- If i <= 7 Then '²Ä¤@¶g
- Set Rng = .Cells(6, i).Offset(, -(i - 1)).Resize(, i)
- ElseIf .Cells(3, i) = 7 Then '¨C¶g
- Set Rng = .Cells(6, i).Offset(, -6).Resize(, 7)
- ElseIf i = Day(DateAdd("M", 1, MoDay) - 1) Then '¤ë©³
- Set Rng = .Cells(6, i).Offset(, -(.Cells(3, i) - 1)).Resize(, .Cells(3, i))
- End If
- With Rng
- .Merge
- .Cells(1) = Application.Evaluate("Sum(" & .Offset(-2).Cells(1).Resize(, .Columns.Count).Address & ")")
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- .WrapText = True
- End With
- End If
- i = i + 1
- Loop
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|