test sheet for protection
You were nearly there, try this:-
Sub isitprotected()
If ActiveSheet.ProtectContents = True Then
MsgBox ("Protected")
Else
MsgBox ("Unprotected")
End If
End Sub
Mike
"David" wrote:
Been racking my brains again...
Tried:
On Error Resume Next
If Not ActiveSheet.Protection Is Nothing Then
MsgBox "sheet is protected"
Else: MsgBox "Sheet is not protected"
On Error GoTo 0
End If
...but alas, no joy, please help
|