I have the following code to change the color of cell when a modification is made in that cell
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex
= 20
End Sub
I want to allow modifications only in certain cells. Thus I want to password protect the rest of the cells in the sheet. The problem is when I make some columns protected and then make changes in unprotected part the above code gives error. How can I modify the above code to satisfy this requirement?
Start Free Trial