Protecting selected Worksheets at Once

  • Thread starter Thread starter Gunjani
  • Start date Start date
G

Gunjani

Since 'Protecting Workbook' does not allow the options as 'Protect
Worksheets' how may I select several worksheets (grouping them or
otherwise) and protect them(obviously with same elements)?

Also how can I identify which worksheets I have selected to group?

--
Many Thanks

Gunjani
Morning comes too early and nighttime falls too late
And sometimes all I want to do is wait
The shadow I've been hiding in has fled from me today
-- Dream Theater, "Surrounded"
 
You can't protect or unprotect in a group.
you have to loop through the sheets to do it

If you know the names of the worksheets? try this

Sub test()
Dim sht As Worksheet
For Each sht In Sheets(Array("Sheet1", "Sheet4"))
sht.Protect Password:="lock"
'sht.Unprotect Password:="lock"
Next sht
End Sub

Or load the selected sheet in a array and loop through that array
 
Hi
you can only protect one worksheet. For more you'll need a macro which
iterates through your worksheets
 
Back
Top