- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-9-10 19:35 ½s¿è
¦^´_ 1# h60327
For i = [K1] To [K1] + 730 ¶W¹L¤@¦~·|³y¦¨¸ê®Æ¤£¥¿½T
«Øij : °²¤é,¥¤é ¶g¤é nקאּ For i = [K1] To DateAdd("yyyy", 1, [k1]) - 1 ¥BK1 ¬On¦P¤@¤Ñ
Á`ªíB2:-> 2011/09 XXXX ¤¤¶¡nªÅ¤@®æ- Sub Ex()
- Dim ¶gªí(), Ds As Object, ªí³æ As Range, R As Range
- Dim Sh As Worksheet, f As Range, D As Date
- ¶gªí = Array("¤@", "¤G", "¤T", "¥|", "¤", "¤»", "¤é") '¬P´Á§O¤§°}¦C
- Set Ds = CreateObject("Scripting.Dictionary")
- With Sheets("Á`ªí") '«ü©w¦bÁ`ªí
- Set ªí³æ = .[B5] 'Á`ªíªº²Ä1Ó¤é´Á
- D = DateValue(Split(.[B2], Space(1))(0)) 'B2:-> 2011/09 XXXX
- For Each Sh In Sheets
- If Sh.Name <> .Name Then '¨Ì§Ç¦b¥¤é,°²¤é,©P¤é µ¥¤u§@ªí
- For Each R In Sh.UsedRange.Columns(3).Cells '²Ä3Äæ
- If R = Month(D) Then Ds(DateSerial(Year(D), R, R.Cells(1, 2))) = R.Cells(1, -1) 'R.Cells(1, -1): ->·í¤éȯZ¤Hû
- 'R = Month(D) ¦P¤@¤ë¥÷
- Next
- End If
- Next
- ªí³æ.Resize(31, 14) = "" '²M°£Â¸ê®Æ
- Do While Month(D) = Month(DateValue(Split(.[B2], Space(1))(0))) '°j°éªº±ø¥ó¬O¦P¤@¤ë¥÷
- Set f = .Cells.Find(Ds(D)) '´M§ä·í¤é¦bªí³æ¸ÌȯZ¤Hûªº¦ì¸m
- .Cells(ªí³æ.Row, f.Column) = "¡´" 'f.Column: ȯZ¤Hû¦ì¸mªºÄæ¼Æ
- With ªí³æ
- .Cells = Day(D) '¼g¤J ¤é¼Æ
- .Cells(1, 2) = ¶gªí(Weekday(D, vbMonday) - 1) '¼g¤J¶Ç¦^¬P´Á§O
- .Resize(, 2).Interior.ColorIndex = IIf(Weekday(D, vbMonday) >= 6, 6, xlNone) '¨îq¥ð°²¤éI´º¦â
- End With
- Set ªí³æ = ªí³æ.Offset(1) '©¹¤U¦ì²¾¤@¦ì
- D = D + 1 '¤é´Á+1¤Ñ
- Loop
- End With
- Set Ds = Nothing
- Set ªí³æ = Nothing
- Set R = Nothing
- Set Sh = Nothing
- End Sub
½Æ»s¥N½X |
|