Protecting Selected Sheets

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
 
S

Steve Klenner

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top