Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Protect-Unprotect all the sheets

Hi All,

If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing that.

Thanks
gary


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Protect-Unprotect all the sheets

You could group the sheets together - right-click on the sheet tab and
click on Select All Sheets. Then whatever you do to one sheet will
also be done to the other sheets, so be careful - select Tools |
Protection | Protect sheet and give your password. You must remember
to right-click the sheet tab again to Ungroup Sheets.

Alternatively, you could have a VBA macro to protect all sheets and
another one to unprotect them.

Hope this helps.

Pete

On Feb 23, 8:21 pm, "Gary" wrote:
Hi All,

If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing that.

Thanks
gary



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Protect-Unprotect all the sheets

Tools Protection Protect Workbook

"Gary" wrote:

Hi All,

If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing that.

Thanks
gary



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default Protect-Unprotect all the sheets

provided all sheets have the same password, this will do

Sub dontblameme()
Dim sht As Worksheet
For Each sht In Sheets
Name = sht.Name
Worksheets(Name).Select
ActiveSheet.Unprotect Password:="YOURPASSWORD"
Next sht
End Sub

"Gary" wrote:

Hi All,

If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing that.

Thanks
gary



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Protect-Unprotect all the sheets

hey pete, when I select all sheets, the 'Unprotect Sheet' option is
disabled. why is that?


"Pete_UK" wrote in message
ups.com...
You could group the sheets together - right-click on the sheet tab and
click on Select All Sheets. Then whatever you do to one sheet will
also be done to the other sheets, so be careful - select Tools |
Protection | Protect sheet and give your password. You must remember
to right-click the sheet tab again to Ungroup Sheets.

Alternatively, you could have a VBA macro to protect all sheets and
another one to unprotect them.

Hope this helps.

Pete

On Feb 23, 8:21 pm, "Gary" wrote:
Hi All,

If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing
that.

Thanks
gary







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Protect-Unprotect all the sheets

Sorry, I've just tried this and the Protect Worksheet option is greyed
out when more than one sheet is grouped, so you won't be able to do it
this way.

Pete

On Feb 23, 8:35 pm, "Pete_UK" wrote:
You could group the sheets together - right-click on the sheet tab and
click on Select All Sheets. Then whatever you do to one sheet will
also be done to the other sheets, so be careful - select Tools |
Protection | Protect sheet and give your password. You must remember
to right-click the sheet tab again to Ungroup Sheets.

Alternatively, you could have a VBA macro to protect all sheets and
another one to unprotect them.

Hope this helps.

Pete

On Feb 23, 8:21 pm, "Gary" wrote:



Hi All,


If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing that.


Thanks
gary- Hide quoted text -


- Show quoted text -



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Protect-Unprotect all the sheets

Hi Mike,

i copied and pasted this but it's not working.

"Mike" wrote in message
...
provided all sheets have the same password, this will do

Sub dontblameme()
Dim sht As Worksheet
For Each sht In Sheets
Name = sht.Name
Worksheets(Name).Select
ActiveSheet.Unprotect Password:="YOURPASSWORD"
Next sht
End Sub

"Gary" wrote:

Hi All,

If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing
that.

Thanks
gary





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Protect-Unprotect all the sheets

Gary

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Protect Password:="justme"
Next n
Application.ScreenUpdating = True
End Sub

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

In both Subs change WS.Protect to WS.Unprotect to go the other way.


Gord Dibben MS Excel MVP

On Fri, 23 Feb 2007 16:52:39 -0700, "Gary" wrote:

Hi Mike,

i copied and pasted this but it's not working.

"Mike" wrote in message
...
provided all sheets have the same password, this will do

Sub dontblameme()
Dim sht As Worksheet
For Each sht In Sheets
Name = sht.Name
Worksheets(Name).Select
ActiveSheet.Unprotect Password:="YOURPASSWORD"
Next sht
End Sub

"Gary" wrote:

Hi All,

If i have a workbook with 15 or more sheets and i want to protect /
unprotect all of them together. How do I do it? going to every sheet and
doing it takes a lot of time....am sure there must be a way of doing
that.

Thanks
gary





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 / Unprotect with checkbox retseort Excel Discussion (Misc queries) 5 October 25th 05 03:45 PM
Macros for Protect/Unprotect all sheets in a workbook Paul Sheppard Excel Discussion (Misc queries) 2 August 4th 05 04:30 PM
Protect/Unprotect Worksheet djn Excel Discussion (Misc queries) 1 May 12th 05 11:27 PM
Is there any way that you can protect or unprotect a group of wor. CheriT63 Excel Discussion (Misc queries) 9 January 8th 05 08:40 PM
Protect/unprotect all worksheets Janna Excel Worksheet Functions 2 January 7th 05 01:01 AM


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