Excel file with 52 sheets

  • Thread starter Thread starter fernango
  • Start date Start date
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
 
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
 
Back
Top