Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet protection
Is there a way to protect or unprotect multiple selected worksheets in a
workbook at the same time or all the worksheets in the workbook at the same time? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet protection
bobb
Only through the use of VBA macros. 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 If not familiar with VBA and macros, see David McRitchie's site for more on "getting started". http://www.mvps.org/dmcritchie/excel/getstarted.htm In the meantime.......... First...create a backup copy of your original workbook. To create a General Module, hit ALT + F11 to open the Visual Basic Editor. Hit CRTL + r to open Project Explorer. Find your workbook/project and select it. Right-click and InsertModule. Paste the code in there. Save the workbook and hit ALT + Q to return to your workbook. Run the macro by going to ToolMacroMacros. You can also assign a macro to a button or a shortcut key combo. Gord Dibben MS Excel MVP On Sun, 7 Jan 2007 17:26:01 -0800, bobb wrote: Is there a way to protect or unprotect multiple selected worksheets in a workbook at the same time or all the worksheets in the workbook at the same time? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet protection
Thanks Gord for all the details, I'll give it a try.
"Gord Dibben" wrote: bobb Only through the use of VBA macros. 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 If not familiar with VBA and macros, see David McRitchie's site for more on "getting started". http://www.mvps.org/dmcritchie/excel/getstarted.htm In the meantime.......... First...create a backup copy of your original workbook. To create a General Module, hit ALT + F11 to open the Visual Basic Editor. Hit CRTL + r to open Project Explorer. Find your workbook/project and select it. Right-click and InsertModule. Paste the code in there. Save the workbook and hit ALT + Q to return to your workbook. Run the macro by going to ToolMacroMacros. You can also assign a macro to a button or a shortcut key combo. Gord Dibben MS Excel MVP On Sun, 7 Jan 2007 17:26:01 -0800, bobb wrote: Is there a way to protect or unprotect multiple selected worksheets in a workbook at the same time or all the worksheets in the workbook at the same time? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet protection status | Excel Discussion (Misc queries) | |||
Cell Protection vs. Worksheet Protection | Excel Discussion (Misc queries) | |||
Worksheet tab protection | Excel Discussion (Misc queries) | |||
copyright and worksheet protection | Excel Discussion (Misc queries) | |||
Seeking help for total worksheet protection | Excel Discussion (Misc queries) |