To Norman or Alan Macro About Macros protected Sheets

G

Guest

Hi, Paul again,
Sorry but I have a last question.
When I type at the end of the Macro code:
Sheets("Critical Path"),protect("My Password")

What else do I need to type to enable the Auto filter & the Data Sort

Thanks

Paul.
 
D

Dave Peterson

Your post is separated from the original thread.

Are you using xl2002+?

If yes, I got this line when I recorded a macro protecting a sheet, but allowing
autofilter and sort:

ActiveSheet.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True, _
AllowSorting:=True, AllowFiltering:=True

So...

worksheets("critical path").protect password:="My Password", _
DrawingObjects:=True, _
Contents:=True, Scenarios:=True, _
AllowSorting:=True, AllowFiltering:=True

may do what you want.

If you want to protect it differently, you could just record a macro when you do
it manually. Excel won't record the password (at least xl2002 won't), but
that's the easy part.
 

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