Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Sheet protection/unprotection

Is there a way to protect all the sheets in a workbook without specifying
each sheet separately. Currently, I select each sheet and then do
ActiveSheet.Unprotect.

Thanks,
Mike.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Sheet protection/unprotection

I found an answer:

For Each sht In ActiveWorkbook.Sheets

ActiveSheet.Protect Password:="password", DrawingObjects:=True,
Contents:=True, Scenarios:=True

Next

The same goes for unprotect.

Thanks,
Mike.



"Mike D." wrote:

Is there a way to protect all the sheets in a workbook without specifying
each sheet separately. Currently, I select each sheet and then do
ActiveSheet.Unprotect.

Thanks,
Mike.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sheet protection/unprotection

Since you're working with the active sheet:

For Each sht In ActiveWorkbook.Sheets
sht.select
ActiveSheet.Protect Password:="password", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
Next sht

or without activating

For Each sht In ActiveWorkbook.Sheets
sht.Protect Password:="password", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
Next sht



Mike D. wrote:

I found an answer:

For Each sht In ActiveWorkbook.Sheets

ActiveSheet.Protect Password:="password", DrawingObjects:=True,
Contents:=True, Scenarios:=True

Next

The same goes for unprotect.

Thanks,
Mike.

"Mike D." wrote:

Is there a way to protect all the sheets in a workbook without specifying
each sheet separately. Currently, I select each sheet and then do
ActiveSheet.Unprotect.

Thanks,
Mike.


--

Dave Peterson
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
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Unprotection of outlined data in protected worksheet Afsha Excel Discussion (Misc queries) 11 January 23rd 07 02:56 PM
Unprotection once performed... FLKULCHAR Excel Discussion (Misc queries) 3 January 5th 05 02:20 AM
Sheet protection error msg - Unrequested sheet activation deltree[_3_] Excel Programming 0 January 28th 04 06:20 PM


All times are GMT +1. The time now is 05:33 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"