.
This code is pasted in the Sheet Level module :
Code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'If the target cell is clear
If Target.Interior.ColorIndex = xlNone Then
'Then change the background to the specified color
Target.Interior.ColorIndex = 6 '6 is yellow
'But if the target cell is already the specified color
ElseIf Target.Interior.ColorIndex = 6 Then
'Then change the background to the specified color
'Target.Interior.ColorIndex = 3 '3 is red
'But if the target cell is already the specified color
'ElseIf Target.Interior.ColorIndex = 3 Then
'Then clear the background color
Target.Interior.ColorIndex = xlNone
End If
End Sub