Hi,

I want to change the backgroundcolor of the active cell. Therefor I use this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Static OldCell As Range

If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
End If

Target.Interior.ColorIndex = 6
Target.Interior.Pattern = xlGray16
Target.Interior.PatternColorIndex = xlAutomatic

Set OldCell = Target

End Sub

The problem is that this is a protected sheet and only two cells are unprotected.
But every time I use the tab function I'm getting an error that the property colorindex of the class Interior could not be used.

Is there a way to solve this problem?

Thanks!