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