Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$1" And [A1].Value > [B1].Value Then Target.Interior.ColorIndex = 3 Else Target.Interior.ColorIndex = xlNone End If End Sub
转自EXCELHOME论坛,很实用的事件触发器,在此记下备忘。
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$1" And [A1].Value > [B1].Value Then Target.Interior.ColorIndex = 3 Else Target.Interior.ColorIndex = xlNone End If End Sub
转自EXCELHOME论坛,很实用的事件触发器,在此记下备忘。