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

I have a workbook containing some 250 worksheets.

Is there some way to protect all worksheets in a workbook instead of having
to protect each one individually?

Thanks,

Bryan
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Protecting worksheets

This should do it.

Sub protectall()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
ActiveSheet.Protect Password:="yourpassword"
Next ws
End Sub

Mike

"Bryan Potter" wrote:

I have a workbook containing some 250 worksheets.

Is there some way to protect all worksheets in a workbook instead of having
to protect each one individually?

Thanks,

Bryan

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Protecting worksheets

How would the script be changed to unprotect all the worksheets?

Thanks for your help,

Bryan

"Mike" wrote:

This should do it.

Sub protectall()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
ActiveSheet.Protect Password:="yourpassword"
Next ws
End Sub

Mike

"Bryan Potter" wrote:

I have a workbook containing some 250 worksheets.

Is there some way to protect all worksheets in a workbook instead of having
to protect each one individually?

Thanks,

Bryan

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Protecting worksheets

By having a second macro very similar to the one below and cunningly adding

UN in front of protect.

Mike

"Bryan Potter" wrote:

How would the script be changed to unprotect all the worksheets?

Thanks for your help,

Bryan

"Mike" wrote:

This should do it.

Sub protectall()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
ActiveSheet.Protect Password:="yourpassword"
Next ws
End Sub

Mike

"Bryan Potter" wrote:

I have a workbook containing some 250 worksheets.

Is there some way to protect all worksheets in a workbook instead of having
to protect each one individually?

Thanks,

Bryan

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 Kaitlin.uk Excel Discussion (Misc queries) 1 January 18th 07 02:21 PM
protecting worksheets David Harrison Excel Discussion (Misc queries) 3 December 17th 06 09:28 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 06: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"