Excel file with 52 sheets

F

fernango

I have received a file that was protected by sheets, means that wvery
single sheet is protected, I got the password, but just wondering if
there is a macro I can use to unprotect every single sheet the protect
it again.

Thanks in advance for your help
 
G

Gord

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Protect Password:="justme" 'adjust pword
Next n
Application.ScreenUpdating = True
End Sub

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Unprotect Password:="justme" 'adjust pword
Next n
Application.ScreenUpdating = True
End Sub


Gord Dibben Microsoft Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top