If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Protecting selected Worksheets at Once
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 -- Regards Ron de Bruin http://www.rondebruin.nl "Gunjani" wrote in message m... 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" |
#2
|
|||
|
|||
Protecting selected Worksheets at Once
Hi
you can only protect one worksheet. For more you'll need a macro which iterates through your worksheets -- Regards Frank Kabel Frankfurt, Germany Gunjani wrote: 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? |
Thread Tools | |
Display Modes | |
|
|