Another Protection Q

J

JudithJubilee

Hello there,

I also would like to know how to protect multiple sheets
within the same workbook at once. I am using 2000.

Thanks

Judith
 
G

Gord Dibben

Judith

VBA code must be used.

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
 
O

Oliver Ferns via OfficeKB.com

Hi,
You can't. You will have to protect each one individually (I believe).

For X = 1 to 3
Sheets(x).protect
Next


Hth,
O
 
Top