Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Protection
Hi, I have a workbook with over 100 sheets in it and each sheet is protected,
at the moment I am unprotecting each sheet one at a time, is there an easyer way to do this, unprotect or protect all the sheets at the same time, so I can make changes to all in one go?. Any ideas. Thanks in advance, Barry. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Protection
These might help.........(watch out for the word-wrap)
Sub ProtectSheets() Worksheets("sheet1").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, password:="aaa" Worksheets("sheet2").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, password:="bbb" Worksheets("sheet3").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, password:="ccc" End Sub Sub UnProtectSheets() Worksheets("sheet1").Unprotect password:="aaa" Worksheets("sheet2").Unprotect password:="bbb" Worksheets("sheet3").Unprotect password:="ccc" End Sub Vaya con Dios, Chuck, CABGx3 "wildauk" wrote: Hi, I have a workbook with over 100 sheets in it and each sheet is protected, at the moment I am unprotecting each sheet one at a time, is there an easyer way to do this, unprotect or protect all the sheets at the same time, so I can make changes to all in one go?. Any ideas. Thanks in advance, Barry. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Protection
On Jun 29, 12:00 pm, CLR wrote:
These might help.........(watch out for the word-wrap) Sub ProtectSheets() Worksheets("sheet1").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, password:="aaa" Worksheets("sheet2").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, password:="bbb" Worksheets("sheet3").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, password:="ccc" End Sub Sub UnProtectSheets() Worksheets("sheet1").Unprotect password:="aaa" Worksheets("sheet2").Unprotect password:="bbb" Worksheets("sheet3").Unprotect password:="ccc" End Sub Vaya con Dios, Chuck, CABGx3 "wildauk" wrote: Hi, I have a workbook with over 100 sheets in it and each sheet is protected, at the moment I am unprotecting each sheet one at a time, is there an easyer way to do this, unprotect or protect all the sheets at the same time, so I can make changes to all in one go?. Any ideas. Thanks in advance, Barry. If the password is the same for every sheet in the worbook: Sub Protect_All() Const STR_PASSWORD As String = "password" Dim sh As Worksheet Application.ScreenUpdating = False For Each sh In Sheets sh.Protect STR_PASSWORD Next sh Application.ScreenUpdating = True End Sub Sub UnProtect_All() Const STR_PASSWORD As String = "password" Dim sh As Worksheet Application.ScreenUpdating = False For Each sh In Sheets sh.Unprotect STR_PASSWORD Next sh Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Protection vs. Worksheet Protection | Excel Discussion (Misc queries) | |||
Worksheet protection is gone and only wokbook protection can be se | Excel Discussion (Misc queries) | |||
Protection | Excel Discussion (Misc queries) | |||
Protection | Excel Worksheet Functions | |||
Another Protection Q | Excel Discussion (Misc queries) |