View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken Warthen[_2_] Ken Warthen[_2_] is offline
external usenet poster
 
Posts: 70
Default Protecting worksheet cause vba code to fail

I have the following code in the Worksheet_Change event of a worksheet.

Case "$E$14" 'Approval status
If Target.Value < "" Then
If Target.Value = "Not Submitted" Then
Target.Font.Color = 255
Else
Target.Font.Color = 0
End If
End If

The code works fine, until I turn on the Protect Sheet feature. Then it
generates an error code 1004 (Application-defined or object-defined error).
Does anyone know why protecting the worksheet would cause the code to fail?

Ken