Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2005

Tip: Looking for answers? Try searching our database.

Sheet protection in mass?!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kane - 12 Jan 2005 06:21 GMT
XL2k,sp3
I have 12 worksheets in a workbook that is book and sheet protected for many
reasons. Is it possable to unprotect / protect ALL sheets at once, to allow
maintenance/upgrade's to the cell contents? Certainly would make it easier
than to have to unlock and lock each sheet.
Tks ....

Kane
Gord Dibben - 12 Jan 2005 07:24 GMT
Kane

Only through VBA.

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 Insert>Module.  Paste the code in there.  Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

Gord Dibben Excel MVP

>XL2k,sp3
>I have 12 worksheets in a workbook that is book and sheet protected for many
[quoted text clipped - 4 lines]
>
>Kane
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.