Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Protecting Worksheets

Is there a way to protect and unprotect several worksheets, in the same
workbookat the same time? Or do you have to do each one individually?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 207
Default Protecting Worksheets

Right click on the first sheet tab, View Code, paste the following code
there.

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each WS In MySheets
WS.Select
WS.Protect Password:="password"
Next WS
End Sub

Now Save and close

Now Right click on the second sheet tab, View Code, paste the following code
there.

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each WS In MySheets
WS.Select
WS.Unprotect Password:="password"
Next WS
End Sub

Save and Close.

Now assign shortcut keys to the macros. for example to protect, CTRL+M and
to unprotect, CTRL+J.

Whenever you want to protect all the sheets, right click on any of the sheet
tabs, click on 'Select all sheets' and press CTRL+M. Same is to unprotect
just press CTRL+J.


"biggrila06" wrote in message
...
Is there a way to protect and unprotect several worksheets, in the same
workbookat the same time? Or do you have to do each one individually?



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
Protecting Worksheets Pistols14 Excel Discussion (Misc queries) 7 November 27th 07 10:14 AM
Protecting worksheets Bryan Potter Excel Discussion (Misc queries) 3 March 9th 07 02:26 PM
Protecting worksheets keiron James Excel Worksheet Functions 1 September 13th 06 04:23 PM
Protecting Worksheets Kathy081403 Excel Worksheet Functions 2 January 12th 06 12:56 AM
Protecting Worksheets saturnin02 Excel Discussion (Misc queries) 9 January 23rd 05 06:10 PM


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

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"