Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 15
End Sub
右键工作表名称--查看代码,在空白处粘贴就可以
或
Alt + F11填上代码
代码:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlColorIndexNone
Target.Interior.ColorIndex = 8 '15
End Sub