Good morning,
All my cells have conditional formatting. I want to overide the background colour if a textbox value on a form matches "CRI" (oCell value) but I do not want to change the cell value. I have tried teh Application.EnableEvents = False but it isn't working. Can someone please tell me if there is anything wrong with my code:
On Error GoTo ws_exit:
Application.EnableEvents = False
myComment = "Cover"
Application.ScreenUpdating = True
ActiveSheet.Unprotect Password:="1234"
For Each oCell In Selection
oCell.Interior.ColorIndex = 45
If oCell.Comment Is Nothing Then oCell.AddComment.Text myComment
If Not (oCell.Comment Is Nothing) Then oCell.Comment.Delete
oCell.AddComment.Text myComment
Next
Application.ScreenUpdating = True
ActiveSheet.Protect Password:="1234"
MsgBox ("Update Complete")
Application.EnableEvents = True
ws_exit:
Application.EnableEvents = True
Exit Sub
Thank you.
JP
Bookmarks