改变单元格内容触发事件(转)

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论坛,很实用的事件触发器,在此记下备忘。

猜你喜欢

转载自www.cnblogs.com/luoye00/p/10863572.html