Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Protect sheets in one go

Hi,

Is there a way to protect all the sheets in a workbook in one go?
I've got 17-19 sheets (it varies).

I could create a macro, but how to handle the different number of
sheets?

Cheers,

Harold
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Protect sheets in one go

something like
for each ws in worksheets
if ws.name<"notthisone" _
and ws.name <"notthisoneeither" then
end if
ws.protect
next ws

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"mohavv" wrote in message
...
Hi,

Is there a way to protect all the sheets in a workbook in one go?
I've got 17-19 sheets (it varies).

I could create a macro, but how to handle the different number of
sheets?

Cheers,

Harold


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Protect sheets in one go

This will do them all...

Sub ProtectAll()
dim wks as worksheet

for each wks in worksheets
wks.protect Password:="Tada"
next wks
end sub
--
HTH...

Jim Thomlinson


"mohavv" wrote:

Hi,

Is there a way to protect all the sheets in a workbook in one go?
I've got 17-19 sheets (it varies).

I could create a macro, but how to handle the different number of
sheets?

Cheers,

Harold

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Protect sheets in one go

or perhaps...

for each ws in worksheets
if ws.name<"notthisone" _
and ws.name <"notthisoneeither" then
ws.protect
end if
next ws
--
HTH...

Jim Thomlinson


"Don Guillett" wrote:

something like
for each ws in worksheets
if ws.name<"notthisone" _
and ws.name <"notthisoneeither" then
end if
ws.protect
next ws

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"mohavv" wrote in message
...
Hi,

Is there a way to protect all the sheets in a workbook in one go?
I've got 17-19 sheets (it varies).

I could create a macro, but how to handle the different number of
sheets?

Cheers,

Harold



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Protect sheets in one go

On Mar 12, 10:54*am, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
This will do them all...

Sub ProtectAll()
dim wks as worksheet

for each wks in worksheets
*wks.protect Password:="Tada"
next wks
end sub
--
HTH...

Jim Thomlinson



"mohavv" wrote:
Hi,


Is there a way to protect all the sheets in a workbook in one go?
I've got 17-19 sheets (it varies).


I could create a macro, but how to handle the different number of
sheets?


Cheers,


Harold- Hide quoted text -


- Show quoted text -


Tx! works fine!
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
Protect some sheets in an xls but not all. lucky1 Excel Worksheet Functions 0 June 6th 07 09:05 PM
Protect-Unprotect all the sheets Gary Excel Worksheet Functions 7 February 26th 07 08:13 PM
password protect sheets rufusf Excel Worksheet Functions 2 March 7th 06 09:00 AM
Protect all Sheets Phil Osman Excel Discussion (Misc queries) 0 June 17th 05 01:55 AM
Protect Sheet > All sheets Adam Excel Discussion (Misc queries) 3 January 31st 05 04:37 PM


All times are GMT +1. The time now is 01:18 PM.

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

About Us

"It's about Microsoft Excel"