unprotect/protect grouped worksheets in excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have multiple sheets in multiple work books and want some to be protected
and others not. I wanted to break links to another work book but found that
the protected sheets would not allow it. I tried to group the sheets
together and then unprotect them but unprotect in the tools menu was greyed
out. How can I unprotect multiple work sheets? Very time consuming doing
this one sheet at a time for 100 sheets.
 
The below code may assist you. Just copy it into a vba module. Please note
where the code says "RTGPAW" this is the password specified for each sheet.
If you have different passwords for each sheet this will not work. If you
don't specify a password then take this section out. Once you do this you can
assign the Macro to a toolbar button if you like. The code can be saved in
either your personal.xls workbook or the individual workbook you are using.


Hope this helps.


Sub UnProtect()
'
' UnProtection Macro
' Macro written by Adam Wood
'

Dim Sheetnumber
Sheetnumber = 1
Do
ActiveWorkbook.Worksheets(Sheetnumber).Activate
ActiveWorkbook.Worksheets(Sheetnumber).UnProtect "rtgpaw"
Sheetnumber = Sheetnumber + 1
Loop Until Sheetnumber = ActiveWorkbook.Worksheets.Count
ActiveWorkbook.UnProtect "rtgpaw"
 
Back
Top