C
Carl Johnson
I've created a command button to clear a worksheet that works well when the
sheet is unprotected, but as soon as I protect it then try to execute the
clear command I get a runtime error "1004' and the debugger takes me to
Worksheets("Services Conducted").Range("Conducted").ClearContents
Could someone tell me why it works OK unprotected but will not when I do
protect it.
Thank you in advance.
Private Sub cmdServicesConducted_Click()
Dim response As Long
response = MsgBox("Caution: You are about to delete your Services Conducted
entries." & vbNewLine & vbNewLine & "Do you wish to continue?", 4, "Delete")
If response = vbYes Then
Worksheets("Services Conducted").Range("Conducted").ClearContents
End If
End Sub
sheet is unprotected, but as soon as I protect it then try to execute the
clear command I get a runtime error "1004' and the debugger takes me to
Worksheets("Services Conducted").Range("Conducted").ClearContents
Could someone tell me why it works OK unprotected but will not when I do
protect it.
Thank you in advance.
Private Sub cmdServicesConducted_Click()
Dim response As Long
response = MsgBox("Caution: You are about to delete your Services Conducted
entries." & vbNewLine & vbNewLine & "Do you wish to continue?", 4, "Delete")
If response = vbYes Then
Worksheets("Services Conducted").Range("Conducted").ClearContents
End If
End Sub