- ©«¤l
- 254
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 310
- ÂI¦W
- 0
- §@·~¨t²Î
- W10
- ³nÅ骩¥»
- Excel 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2019-6-16
- ³Ì«áµn¿ý
- 2024-9-23
|
½Ð°Ýã´£¤j¤j¡@¦pªGn³]©w´X½ü¤W¡@©]¯Z¡@¤é¯Z¡@°²³]¤@½ü¬O¢°¢±¤Ñ
¸Ó¦p¦ó¼g©O¡H
·Ç´£¤j¤jªºª©¥»¡@±Æª©§ó¬O²M·¡¡@¦ý§ÚÀ³¸Ó¦bþ¤@¬qקï¡@n«ç»ò¼g¡H¡@
¥H¤U¬O¤§«eקï¹Lªº¡@¦ý¹ï§Ú¨Ó»¡¤w¸g¬O·¥¤F¡D¡D¹ê¦b·Q¤£¥X¨Ó¡@¡ÖÈСÕ
°ÝÃD¥X¦b³o¸Ì¡G
¦pªG¥Î¡@ÈУ@£@ÈС@¶g¼Æpºâ¤W¯Zªº¤Ñ¼Æ´N·|¦³°ÝÃD¡D¡D¤£ª¾¦p¦óקï¡@
ÈТìÈФѼƷ|·f¤£¨ì¡@¡@
Select Case DateAdd("d", -1, K) Mod Cells(1, 3) + 1 '±`¤é¯Z
Case 1 To Cells(1, 4)
G.Offset = "¤W¯Z"
G.Offset.Font.Color = RGB(0, 0, 89)
G.Interior.Color = RGB(150, 201, 123)
Case Cells(1, 4) + 1 To Cells(1, 4) + Cells(1, 5)
If G.Offset >= Cells(1, 1) Then
G.Offset = "¥ð°²"
G.Offset.Font.Color = RGB(114, 0, 55)
G.Offset.Interior.Color = RGB(255, 255, 92)
End If
End Select
Select Case DateAdd("d", -1, K) Mod Cells(1, 7) + 1 '©P½ü¯Z
Case 1 To Cells(1, 4)
G.Offset = "©]¯Z"
G.Offset.Font.Color = RGB(114, 0, 55)
G.Offset.Interior.Color = RGB(255, 208, 0)
Case Cells(1, 4) + 1 To Cells(1, 4) + Cells(1, 5)
End Select
¡@¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð- Public Sub ©P½ü¯Z½m²ß()
- Range(Cells(2, 1).End(xlToRight), Cells(2, 1).End(xlDown)).Clear
- Cells(1, 3) = Cells(1, 4) + Cells(1, 5)
- Cells(1, 7) = Cells(1, 3) * 2
- If Cells(1, 2) = "" Then
- Cells(1, 2) = Year(Date)
- Else
- Cells(1, 2) = Cells(1, 2)
- End If
- S = 3
- E = 1
- For F = 1 To 12 '«Ø¥ß½d³ò
- For P = 1 To Day(DateSerial(Cells(1, 2), F + 1, 0))
- Cells(S, E) = DateSerial(Cells(1, 2), F, P)
- Cells(S - 1, E) = F & "¤ë" & P & "¤é" & WeekdayName(Weekday(P))
- E = E + 1
- If P = Day(DateSerial(Cells(1, 2), F + 1, 0)) Then
- If F = 12 Then Exit For
- S = S + 2
- E = 1
- End If
- Next P
- Next F
-
- For E = ActiveWorkbook.Names.Count To 1 Step -1 '²M°£©w¸q¦WºÙ
- If ActiveWorkbook.Names(E).Name <> "" Then
- ActiveWorkbook.Names(E).Delete
- End If
- Next E
-
- Y = 65
- For i = 3 To Cells(3, 1).End(xlDown).Row Step 2 '©w¸q¦WºÙ
- ½d³ò¦WºÙ = Chr(Y)
- Names.Add Name:="²Ä" & ½d³ò¦WºÙ & "¶µ", RefersTo:=Range(Cells(i, 1), Cells(i, 1).End(xlToRight))
- Y = Y + 1
- Next i
-
- Set AWN = ActiveWorkbook.Names '¦X¨Ö
- For R = 1 To AWN.Count
- If R <> 1 Then
- K = Mid(AWN(R).RefersToR1C1Local, 2, Len(AWN(R))) & ","
- Else
- K = AWN(R).RefersToR1C1Local & ","
- End If
- U = U + K
- Next R
- Names.Add Name:="«ü©w½d³ò", RefersTo:=Mid(U, 1, Len(U) - 1)
-
- For E = ActiveWorkbook.Names.Count To 1 Step -1 '²M°£©w¸q¦WºÙ
- If ActiveWorkbook.Names(E).Name <> "«ü©w½d³ò" Then
- ActiveWorkbook.Names(E).Delete
- End If
- Next E
-
- If Cells(1, 1) = "" Then
- Cells(1, 1) = Cells(3, 1)
- Else
- Cells(1, 1) = Cells(1, 1)
- End If
-
- D = Cells(1, 1)
-
- For Each G In Range("«ü©w½d³ò") '©P½ü¯Z
- If G.Offset >= Cells(1, 1) Then
- If Weekday(G) = 1 Or Weekday(G) = 7 Then '¤»¤é¤W¦â
- G.Offset(-1, 0).Interior.Color = RGB(172, 199, 213)
- End If
-
- K = G.Offset
-
- Select Case DateAdd("d", -1, K) Mod 6 + 1 '±`¤é¯Z
- Case 1 To 4
- G.Offset = "¤W¯Z"
- G.Offset.Font.Color = RGB(0, 0, 89)
- G.Interior.Color = RGB(150, 201, 123)
- Case 5 To 6
- If G.Offset >= Cells(1, 1) Then
- G.Offset = "¥ð°²"
- G.Offset.Font.Color = RGB(114, 0, 55)
- G.Offset.Interior.Color = RGB(255, 255, 92)
- End If
- End Select
-
- Select Case DateAdd("d", -1, K) Mod 12 + 1 '©P½ü¯Z
- Case 1 To 4
- G.Offset = "©]¯Z"
- G.Offset.Font.Color = RGB(114, 0, 55)
- G.Offset.Interior.Color = RGB(255, 208, 0)
- Case 5 To 6
- End Select
-
- End If
- Next G
-
- End Sub
½Æ»s¥N½X |
|