ColinCoady
New Member
- Joined
- Mar 21, 2019
- Messages
- 35
Not sure why this is happening. The following code works fine when sheet is Unprotected but gives a Run-time error '1004' Application-defined or object-defined error when the sheet is protected. All the cells involved are unlocked. Can anyone figure out the issue & provide a solution? I don't want to leave the sheet unprotected.
Thanks
-Colin
Thanks
-Colin
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$E$7" Then Exit Sub
If Target <> "Other%" Then Target.Offset(0, 2).ClearContents
If Target <> "Other%" Then Target.Offset(0, 2).Interior.ColorIndex = 0
If Target = "Other%" Then Target.Offset(0, 2).Select
If Target = "Other%" Then Target.Offset(0, 2).Interior.ColorIndex = 27
End Sub