I have a billing excel sheet in which I use the following code to highlight any cell the user has selected. But this code doesnt work on any of my protected sheets. If I create a new sheet, it works on it.
How do I modify this VBA code to get it working on all the protected sheets.
How do I modify this VBA code to get it working on all the protected sheets.
VBA Code:
Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Static xLastRng As Range
On Error Resume Next
Target.Interior.ColorIndex = 6
xLastRng.Interior.ColorIndex = xlColorIndexNone
Set xLastRng = Target
End Sub