Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Protect Sheet > All sheets
Hi
I'm using Excel 97 and get a bit annoyed having to Protect each worksheet individually. Is there a way where I can password protect all sheets in a workbook? Please advise -- Adam ----------- Windows 98 + Office Pro 97 |
#2
|
|||
|
|||
Hi Adam
only by using code such as: Sub ProtectAll() For each ws in sheets ws.protect("pwd") Next End Sub 'and to unprotect Sub UnprotectAll() For each ws in sheets ws.unprotect("pwd") Next End Sub ---- Please post back if you'ld like assistance using this code. Note - you'll need to change pwd to your actual password. Cheers JulieD "Adam" wrote in message ... Hi I'm using Excel 97 and get a bit annoyed having to Protect each worksheet individually. Is there a way where I can password protect all sheets in a workbook? Please advise -- Adam ----------- Windows 98 + Office Pro 97 |
#3
|
|||
|
|||
You have to use VBA for this. This example willl assign the same password to
each sheet. I'm running 2003, and this works for me. If you are unfamiliar with macors, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm Sub ProtectAllSheets() Dim sht As Worksheet For Each sht In ThisWorkbook.Worksheets sht.Protect "password" Next sht End Sub tj "Adam" wrote: Hi I'm using Excel 97 and get a bit annoyed having to Protect each worksheet individually. Is there a way where I can password protect all sheets in a workbook? Please advise -- Adam ----------- Windows 98 + Office Pro 97 |
#4
|
|||
|
|||
Only through a macro, put these 2 macros in a module (Alt + F11, insertmodule)
Sub ProtectMe() Dim sh As Worksheet Application.ScreenUpdating = False For Each sh In ThisWorkbook.Worksheets sh.Protect "xxxxx" Next sh Application.ScreenUpdating = True End Sub Sub UnProtectMe() Dim sh As Worksheet Application.ScreenUpdating = False For Each sh In ThisWorkbook.Worksheets sh.Unprotect "xxxxx" Next sh Application.ScreenUpdating = True End Sub replace "xxxxx" with whatever password you want to use press Alt + q to close the VBE and save the workbook. To run the macros press Alt + F8 Regards, Peo Sjoblom "Adam" wrote: Hi I'm using Excel 97 and get a bit annoyed having to Protect each worksheet individually. Is there a way where I can password protect all sheets in a workbook? Please advise -- Adam ----------- Windows 98 + Office Pro 97 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Variable validation-password protect sheet | Excel Worksheet Functions | |||
Printing separate sheets on one paper sheet | Excel Discussion (Misc queries) | |||
Linking sheets to a summary sheet in workbook | Excel Discussion (Misc queries) | |||
linking multiple sheets to a summary sheet | Excel Discussion (Misc queries) | |||
Naming & renaming a sheet tab | Excel Worksheet Functions |