Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello.
I'm looking for a macro to run to protect all worksheets in a workbook, I have about 50 worksheets and its a lot of work going through the protection menu for every worksheet, Can someone give me a macro to run so when run it protects all worksheets in the workbook and also one to run to unprotect all worksheets in a workbook. many Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 UnprotectAllSheets() Application.ScreenUpdating = False Dim n As Single For n = 1 To Sheets.Count Sheets(n).Unprotect Password:="justme" Next n Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Mon, 4 Feb 2008 14:02:00 -0800, santaviga wrote: Hello. I'm looking for a macro to run to protect all worksheets in a workbook, I have about 50 worksheets and its a lot of work going through the protection menu for every worksheet, Can someone give me a macro to run so when run it protects all worksheets in the workbook and also one to run to unprotect all worksheets in a workbook. many Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks
"Gord Dibben" wrote: 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 UnprotectAllSheets() Application.ScreenUpdating = False Dim n As Single For n = 1 To Sheets.Count Sheets(n).Unprotect Password:="justme" Next n Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Mon, 4 Feb 2008 14:02:00 -0800, santaviga wrote: Hello. I'm looking for a macro to run to protect all worksheets in a workbook, I have about 50 worksheets and its a lot of work going through the protection menu for every worksheet, Can someone give me a macro to run so when run it protects all worksheets in the workbook and also one to run to unprotect all worksheets in a workbook. many Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
macro for protection | Excel Discussion (Misc queries) | |||
Macro protection | Excel Programming | |||
macro protection | Excel Programming | |||
Protection + Macro = NOTHING! | Excel Programming |