Is there a quick way to lock all pages in a workbook at one time?

T

teckie

I have several wrokbooks that have 20 to 50 pages each. I want users to be
able to view or print the informatin, but not change the data. Any
suggestions on how to secure all the pages at one time?
 
B

Bill Kuunders

one way

save as
on right hand top of window find <tools>
enter a password
twice
tick the box read only recommended.

Regards
Bill K
 
G

Gord Dibben

teckie

By "pages" I assume you mean "worksheets".

You can Protect all sheets using the Macro code below.

I also provide an "Unprotect" macro.

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Protect Password:="password"
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:="password"
Next n
Application.ScreenUpdating = True
End Sub

Be sure to protect the VBA Project so's your users can't see the "password".

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..........

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 above 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
 
Top