Private Sub Worksheet_Change(ByVal Target As Range)
For Each x In Range("b1:b10")
Select Case x
Case Is < 0: x.Interior.ColorIndex = 42: x.Font.ColorIndex = 6
Case Is < 10: x.Interior.ColorIndex = 40: x.Font.ColorIndex = 5
Case Is < 20: x.Interior.ColorIndex = 35: x.Font.ColorIndex = 4
Case Is < 30: x.Interior.ColorIndex = 34: x.Font.ColorIndex = 3
Case Is < 40: x.Interior.ColorIndex = 33: x.Font.ColorIndex = 2
Case Is < 50: x.Interior.ColorIndex = 32: x.Font.ColorIndex = 1
Case Is > 50: x.Interior.ColorIndex = 6: x.Font.ColorIndex = 42
End Select
Next
End Sub作者: lai123 時間: 2015-5-18 10:42