U
uncbluegal
I've entered the following code within my excel document:
Sub UnlockAllSheets()
Const thePassword = "filepassword"
Dim anySheet As Worksheet
For Each anySheet In ThisWorkbook.Worksheets
anySheet.Unprotect Password:=thePassword
Next
End Sub
Sub LockAllSheets()
Const thePassword = "filepassword"
Dim anySheet As Worksheet
For Each anySheet In ThisWorkbook.Worksheets
anySheet.Protect Password:=thePassword
Next
End Sub
I have many locked and unlocked cells within this 13 worsheet workbook. I
can easily run either the unlock or lock macro - but - I'm never asked for
the password when I run either macro. Why is this?
Sub UnlockAllSheets()
Const thePassword = "filepassword"
Dim anySheet As Worksheet
For Each anySheet In ThisWorkbook.Worksheets
anySheet.Unprotect Password:=thePassword
Next
End Sub
Sub LockAllSheets()
Const thePassword = "filepassword"
Dim anySheet As Worksheet
For Each anySheet In ThisWorkbook.Worksheets
anySheet.Protect Password:=thePassword
Next
End Sub
I have many locked and unlocked cells within this 13 worsheet workbook. I
can easily run either the unlock or lock macro - but - I'm never asked for
the password when I run either macro. Why is this?