Protecting Selected Sheets

  • Thread starter Thread starter Steve Klenner
  • Start date Start date
S

Steve Klenner

This macro used to work...I am now using Excel 2003....it appears to fail at
line ... sht.Protect password="lock"
Any help would be appreciated
*******************************
Sub ProtectAllSheets()
Sheets("Sheet1").Select
Sheets("Sheet2").Select
Sheets("Sheet9").Select
Sheets("Sheet11").Select
For Each sht In Sheets
sht.Protect Password:="lock"
Next sht
End Sub
*******************************
Thanks
Steve
 
I probably should have explained better what I'm attempting to do with this
macro...

I want to be able to select certain sheets within a workbook and protect
them with a password.

I'd like to have a subsequent macro that would do the opposite....select
same sheets and un-protect them.

Thanks
 
Back
Top