Macro

D

Deepwater

I would like to create a Macro to open worksheets( 30 or 31 sheets in one
work book) and protect with password.

Any Help will be appreciated.

Thanks
 
F

Frank Kabel

Hi
as a starting point I would try to record a macro while doing this
manually. This should give you the right direction
 
G

Gord Dibben

Deep

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
 
Top