Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static Prng As Range
Static num As Integer
On Error Resume Next
Prng.Interior.ColorIndex = num
num = Target.Cells(1).Interior.ColorIndex
Target.Cells(1).Interior.ColorIndex = 6
Set Prng = Target.Cells(1)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static Prng As Range
Static num(4) As Integer
On Error Resume Next
Prng.Cells(1).Interior.ColorIndex = num(0)
Prng.Cells(1).Offset(1).Interior.ColorIndex = num(1)
Prng.Cells(1).Offset(-1).Interior.ColorIndex = num(2)
Prng.Cells(1).Offset(, 1).Interior.ColorIndex = num(3)
Prng.Cells(1).Offset(, -1).Interior.ColorIndex = num(4)
num(0) = Target.Cells(1).Interior.ColorIndex
num(1) = Target.Cells(1).Offset(1).Interior.ColorIndex
num(2) = Target.Cells(1).Offset(-1).Interior.ColorIndex
num(3) = Target.Cells(1).Offset(, 1).Interior.ColorIndex
num(4) = Target.Cells(1).Offset(, -1).Interior.ColorIndex
Target.Cells(1).Offset(-1).Resize(3).Interior.ColorIndex = 6
Target.Cells(1).Offset(, -1).Resize(, 3).Interior.ColorIndex = 6
Set Prng = Target.Cells(1)
End Sub