Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
pjd
 
Posts: n/a
Default Protecting Multiple Sheets

Hi

I have a workbook with 60 sheets in it. I need to protect 52 sheets only.

Is there a way I can do this collectively instead of each one individaully??

Cheers
--
All help much appreciated.

Thanks
  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi

one way is to run the following code:
---
Sub ProtectAll()
For Each ws In Sheets
ws.Protect ("pwd")
Next

Set sh = ActiveSheet
varr = Array("Sheet1", "sheet3")
For i = LBound(varr) To UBound(varr)
With Worksheets(varr(i))
.Activate
.Unprotect ("pwd")
End With
Next
sh.Activate
End Sub
--
in the line
varr = Array("Sheet1", "sheet3")
list the names of the sheets you do not want protected.

note: this code applies a password of pwd to the protected sheets - if you
want another password just replace pwd (in 2 places) with the password you
want, if you don't want a password just delete the ("pwd") bit.

to use this code, right mouse click on any sheet tab, choose view code, to
display the vbe window, choose insert / module, copy & paste the code in
there, make the changes and then use ALT & F11 to switch back to your
workbook. Choose tools / macro / macros, find Protect all and choose RUN

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"pjd" wrote in message
...
Hi

I have a workbook with 60 sheets in it. I need to protect 52 sheets only.

Is there a way I can do this collectively instead of each one
individaully??

Cheers
--
All help much appreciated.

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting multiple sheets to multiple htm files? [email protected] Excel Discussion (Misc queries) 4 April 2nd 05 01:26 PM
Copying multiple sheets from one book 2 another and undertake spec Pank Mehta Excel Discussion (Misc queries) 14 March 16th 05 04:41 PM
Protecting multiple sheets mik00725 Excel Discussion (Misc queries) 1 February 17th 05 02:36 AM
Multiple sheets selected twa14 Excel Discussion (Misc queries) 2 December 21st 04 11:15 AM
linking multiple sheets to a summary sheet greg g Excel Discussion (Misc queries) 1 December 16th 04 07:43 AM


All times are GMT +1. The time now is 06:06 AM.

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

About Us

"It's about Microsoft Excel"