Unprotect All Sheets with Masked Password

thomasutra

New member
Joined
Jan 23, 2014
Messages
1
Reaction score
0
Points
0
I'm working with a workbook that has many sheets, each protected with the same password. I want to be able to unprotect all the sheets at once only being prompted by the password once. The following code works almost perfectly. It does EXACTLY what I want it to do EXCEPT it doesn't mask the password when I type it in. I know nothing about vba or programming/ coding. I literally copied the following from another forum and inserted it in a module in my file. I've heard things about creating a form and changing the password char to do this, but don't have a clue of what I'm doing. If anyone can help manipulate the following code (I would need something I can literally copy and paste straight up, I'm that ignorant) or give me another method (in exact, idiot steps), that would be extremely helpful! Thanks!

Sub UnprotectAllSheets()
Dim ws As Worksheet
Dim strPwd As String
Dim strCheck As String
strCheck = "PASSWORD"
strPwd = InputBox("Enter Password to Unprotect All Sheets", "Password", "Enter Password")
If strPwd = strCheck Then
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:=strPwd
Next ws
Else
MsgBox "Incorrect Password"
End If
End Sub
 
Last edited:
Back
Top