Hi,
I need to write an If statment that will not run a a macro if the sheet is protected
I have a sheet where there is a 'lock' button that protects the sheet but if its clicked again it causes an error, i want it to test if the sheet is protected before it run.
something like
Cheers
I need to write an If statment that will not run a a macro if the sheet is protected
I have a sheet where there is a 'lock' button that protects the sheet but if its clicked again it causes an error, i want it to test if the sheet is protected before it run.
something like
Code:
if activeworkbook.protected = TRUE Then
' run the rest of the macro
Else
' display a pop up message saying its already protected
Cheers