I found this code on the web and have slightly modified it, it works okay but it works everywhere.
How would I restrict it's operation to a specific range i.e ("E10:F100")
I have tried various IF statements without success, I have tried setting a Range called "Staff" and tried to use Target but I'm getting nowhere, any suggestion please, Many thanks Mike.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Static OldRange As Range
Target.Interior.Color = RGB(216, 216, 235)
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target
End Sub
How would I restrict it's operation to a specific range i.e ("E10:F100")
I have tried various IF statements without success, I have tried setting a Range called "Staff" and tried to use Target but I'm getting nowhere, any suggestion please, Many thanks Mike.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Static OldRange As Range
Target.Interior.Color = RGB(216, 216, 235)
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target
End Sub