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
  #1  
Old March 18th, 2004, 07: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"



Ads
  #2  
Old March 18th, 2004, 07:56 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default 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

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 02:09 AM.


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