Change passwords Multiple sheets

B

bbc1

I have a workbook containing 20 sheets each is password protected with the
same password, I would like to change this password on each sheet without
having to open each sheet and do it individually
 
G

Gord Dibben

Insert your current password into the UnProtectAllSheets sub and run it

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

Then run this one with your new password inserted

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


Gord Dibben Excel MVP
 
Top