A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Protecting selected Worksheets at Once



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old March 18th, 2004, 08:52 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default 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"



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.