Determine if a sheet is protected?

  • Thread starter Thread starter Robert Crandal
  • Start date Start date
Sub test()

MsgBox ActiveSheet.ProtectionMode 'returns true or false

End Sub


Gord Dibben MS Excel MVP
 
With worksheets("SomeSheetNameHere")
If .ProtectContents = True _
Or .ProtectDrawingObjects = True _
Or .ProtectScenarios = True Then
'it's protected
else
'it's not protected
End with
 
Back
Top