Here's what I have, am trying to run code depending on whether or not the worksheet is protected.
Sheets("SheetName").Select
If ActiveSheet.Unprotect = True Then
MsgBox ("Not Protected")
'Run Code 1 Here
Exit Sub
End If
If ActiveSheet.Protect = True Then
MsgBox ("Protected")
'Run Code 2 here
Exit Sub
End If
but this only seems to protect the sheet if it isn't protected and vice versa...
Sheets("SheetName").Select
If ActiveSheet.Unprotect = True Then
MsgBox ("Not Protected")
'Run Code 1 Here
Exit Sub
End If
If ActiveSheet.Protect = True Then
MsgBox ("Protected")
'Run Code 2 here
Exit Sub
End If
but this only seems to protect the sheet if it isn't protected and vice versa...