|
我这儿有一个,抄的
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Select Case Target.Value
Case "蓝"
Target.Font.Color = RGB(255, 255, 255)
Target.Interior.Color = RGB(0, 0, 255)
Case "红"
Target.Font.Color = RGB(255, 255, 255)
Target.Interior.Color = RGB(255, 0, 0)
Case "黄"
Target.Font.Color = RGB(0, 0, 0)
Target.Interior.Color = RGB(255, 255, 0)
Case "绿"
Target.Font.Color = RGB(0, 0, 0)
Target.Interior.Color = RGB(0, 255, 0)
Case "白"
Target.Font.Color = RGB(0, 0, 0)
Target.Interior.Color = RGB(255, 255, 255)
Case "黑"
Target.Font.Color = RGB(255, 255, 255)
Target.Interior.Color = RGB(0, 0, 0)
End Select
End If
End Sub |
|