Unprotect Multiple Sheets at Once With VBA Code

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Unprotect multiple sheets at once with VBA code

I. If you are good at VBA code, the following code may be help you quickly to unprotect
multiple sheets at once.
II. 1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for
Applications window.
III. 2. Click Insert > Module, and paste the following code in the Module Window.

Sub unprotect_all_sheets()
On Error Goto booboo
unpass = InputBox("Please enter the password:")
For Each Worksheet In ActiveWorkbook.Worksheets
Worksheet.Unprotect Password:=unpass
Next
Exit Sub
booboo: MsgBox "There is s problem - check your password, capslock, etc."
End Sub

IV. 3. Then press F5 key to run the code, and enter the password that you have applied for
the protected sheets. (the protected sheets must have the same password)See
screenshot:

V.
VI. 4. Click OK, and the protected sheets have been unprotected at once.

You might also like