The macro below still gives me an error.
Sub UnProtectMultipleSheets()
Const PWORD As String = "drowssap"
Dim wkSht As Worksheet
For Each wkSht In Worksheets
wkSht.Unprotect PWORD
Next wkSht
End Sub
Although I protect the test worksheets with "drowssap" using a macro,
the unprotect above does not work. I get run time error 1004 and the
message that the password is not correct. I checked the spelling and
case, no luck.
Here is the macro, which works well, that I used to protect the
worksheets.
Public Sub ProtectAll()
Const PWORD As String = "drowssap"
Dim wkSht As Worksheet
For Each wkSht In Worksheets
wkSht.Protect PASSWORD:=PWORD
Next wkSht
End Sub
The c and the o are only mnemonics (for constant and object) that
were specified for variables in the code I lifted the procedure from
and have no effect on the operation of the macro. This would work
just as well:
Public Sub Larry()
Const Curly As String = "drowssap"
Dim Moe As Worksheet
For Each Moe In Worksheets
Moe.Unprotect Password:=Curly
Next Moe
End Sub
_____________
Tippy