Workbook Protection

J

John

I have created a workbook with 5 different worksheets.
In each worksheet I have hidden certain rows. I want to
be able to protect the hidden rows so that they can not
be unhidden. Is there a way to protect the workbook so
the rows are hidden without doing each sheet
individually? I tried to use the Protect Workbook
feature but when I tested it did not work. any help
would be appreciated.

Thanks,

John
 
D

Dave Peterson

Not manually.

You could have a macro that cycles through the worksheet and protects each of
them, though.

Option Explicit
Sub protectAll()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:="hi there!"
Next wks
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top