#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
wally
 
Posts: n/a
Default Sheet Protection


Ken Johnson wrote:
Hi Wally,

The following macros worked for me...

To protect some sheets first use Shift-Click Tab to group those sheets
then run the following macro...

Public Sub ProtectSelectedSheets()
Dim Sht As Worksheet
Dim ncProtect As New Collection
For Each Sht In ActiveWindow.SelectedSheets
ncProtect.Add Item:=Sht
Next Sht
Worksheets(1).Select
For Each Sht In ncProtect
Sht.Protect
Next Sht
End Sub

To Unprotect some protected sheets first use Shift-Click Tab to group
those sheets then run the following macro...

Public Sub UnprotectSelectedSheets()
Dim Sht As Worksheet
Dim ncUnprotect As New Collection
For Each Sht In ActiveWindow.SelectedSheets
ncUnprotect.Add Item:=Sht
Next Sht
Worksheets(1).Select
For Each Sht In ncUnprotect
Sht.Unprotect
Next Sht
End Sub

I have assumed that you have NOT used passwords to protect your sheets.

Ken Johnson


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
Lookup function and compare Student Excel Discussion (Misc queries) 8 April 25th 06 03:11 PM
Cell but not sheet protection HLS Excel Discussion (Misc queries) 2 April 5th 06 12:38 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
Filter Switches vs Sheet Protection? Ken Excel Discussion (Misc queries) 3 February 23rd 05 09:38 PM
Naming & renaming a sheet tab Cgbilliar Excel Worksheet Functions 1 November 7th 04 05:57 PM


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