Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting Worksheets | Excel Discussion (Misc queries) | |||
protecting worksheets | Excel Discussion (Misc queries) | |||
Protecting worksheets | Excel Worksheet Functions | |||
Protecting Worksheets | Excel Worksheet Functions | |||
Protecting Worksheets | Excel Discussion (Misc queries) |