Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() -- Is it possible to protect/unprotect all worksheets in a workbook at once instead of having to do each individually if the password is the same? News Gal |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The only way to do that is with some VBA code:
Sub ProtectAll() Dim WS As Worksheet For Each WS In ActiveWorkbook.Worksheets WS.Protect Password:="whatever" Next WS End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Newsgal" wrote in message ... -- Is it possible to protect/unprotect all worksheets in a workbook at once instead of having to do each individually if the password is the same? News Gal |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The only way is to use a macro to do this
Sub test() Dim sh As Worksheet For Each sh In ThisWorkbook.Worksheets sh.Unprotect "ron" Next sh End Sub Or sh.Protect "ron" -- Regards Ron de Bruin http://www.rondebruin.nl "Newsgal" wrote in message ... -- Is it possible to protect/unprotect all worksheets in a workbook at once instead of having to do each individually if the password is the same? News Gal |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This macro would do the trick
Sub Unprotect() Dim wb As Workbook Dim ws As Worksheet Dim blnIsProtected As Boolean Set wb = ActiveWorkbook For Each ws In wb.Worksheets ws.Unprotect "test" Next ws Set wb = Nothing Set ws = Nothing End Sub -- Kevin Backmann "Newsgal" wrote: -- Is it possible to protect/unprotect all worksheets in a workbook at once instead of having to do each individually if the password is the same? News Gal |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need to know how to protect the entire worksheet (all tabs within it) with
a click of a button; not sure what the last solution entails. Please help. ers |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 Tue, 4 May 2010 10:11:01 -0700, ers18 wrote: I need to know how to protect the entire worksheet (all tabs within it) with a click of a button; not sure what the last solution entails. Please help. ers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting all worksheets of a workbook | Excel Discussion (Misc queries) | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
Appending external worksheets into existing workbook? | Links and Linking in Excel | |||
How do I build a workbook from the worksheets another workbook? | Excel Discussion (Misc queries) | |||
how do i link a list of items in a workbook to worksheets in the . | Excel Discussion (Misc queries) |