Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.Color = 16777215
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.Color = 192
End Sub
VBA没有提供单击事件,只好用SelectionChange 事件
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Application.EnableEvents = False
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Target.Interior.Color = 255
Application.EnableEvents = True
End Sub