|
Sub 填色()
Dim i%
With Application
.ScreenUpdating = False
For i = 1 To 31
If .Cells(6, i + 6) <> "" Then
If Weekday(.Cells(6, i + 6), 2) > 5 And .Cells(5, i + 6) = "" Or .Cells(5, i + 6) = "放假" Then
Range(Cells(7, i + 6), Cells(116, i + 6)).Interior.Color = RGB(141, 180, 226)
Else
Range(Cells(7, i + 6), Cells(116, i + 6)).Interior.Color = RGB(255, 255, 255)
End If
If Cells(5, i + 6) = "法定假" Then
Cells(7, i + 6).Resize(110, 1).Interior.Color = RGB(218, 150, 148)
End If
Else
Range(Cells(7, i + 6), Cells(116, i + 6)).Interior.Color = RGB(255, 255, 255)
End If
For r = 1 To 110
If .Cells(r + 6, 4) = "5★" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(49, 134, 155)
End If
If .Cells(r + 6, 4) = "4★S" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(192, 80, 77)
End If
If .Cells(r + 6, 4) = "4★J" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(255, 0, 0)
End If
If .Cells(r + 6, 4) = "3★S" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(0, 128, 0)
End If
If .Cells(r + 6, 4) = "3★J" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(255, 0, 255)
End If
If .Cells(r + 6, 4) = "2★S" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(226, 107, 10)
End If
If .Cells(r + 6, 4) = "2★J" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(0, 0, 255)
End If
If .Cells(r + 6, 4) = "1★" Then
Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(0, 0, 0)
End If
Next r
Next i
End With
SendKeys "{F9}"
End Sub- Sub 填色()
- Dim i%
- With Application
- .ScreenUpdating = False
- For i = 1 To 31
- If .Cells(6, i + 6) <> "" Then
- If Weekday(.Cells(6, i + 6), 2) > 5 And .Cells(5, i + 6) = "" Or .Cells(5, i + 6) = "放假" Then
- Range(Cells(7, i + 6), Cells(116, i + 6)).Interior.Color = RGB(141, 180, 226)
- Else
- Range(Cells(7, i + 6), Cells(116, i + 6)).Interior.Color = RGB(255, 255, 255)
- End If
- If Cells(5, i + 6) = "法定假" Then
- Cells(7, i + 6).Resize(110, 1).Interior.Color = RGB(218, 150, 148)
- End If
- Else
- Range(Cells(7, i + 6), Cells(116, i + 6)).Interior.Color = RGB(255, 255, 255)
- End If
- For r = 1 To 110
- If .Cells(r + 6, 4) = "5★" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(49, 134, 155)
- End If
- If .Cells(r + 6, 4) = "4★S" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(192, 80, 77)
- End If
- If .Cells(r + 6, 4) = "4★J" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(255, 0, 0)
- End If
- If .Cells(r + 6, 4) = "3★S" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(0, 128, 0)
- End If
- If .Cells(r + 6, 4) = "3★J" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(255, 0, 255)
- End If
- If .Cells(r + 6, 4) = "2★S" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(226, 107, 10)
- End If
- If .Cells(r + 6, 4) = "2★J" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(0, 0, 255)
- End If
- If .Cells(r + 6, 4) = "1★" Then
- Range(Cells(r + 6, 1), Cells(r + 6, 6)).Font.Color = RGB(0, 0, 0)
- End If
- Next r
- Next i
- End With
- SendKeys "{F9}"
- End Sub
复制代码
|
|