How to password protect several excel workbook pages using a macro
Assume by "pages" you mean "worksheets".
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 Excel MVP
On Mon, 27 Sep 2004 21:27:02 -0700, "p88t"
wrote:
I can write a macro to protect lots of pages in a big workbook, but they are
protected without a password. How can I password protect them? I use Excel
2000.
|