Macro to allow auto filter after running password protect

R

Roady

Hi:

I have a spreadsheet that is protected. In that spreadsheet, I also have
three macros with corresponding buttons to run three different report (plus a
reset button). I need to be able to allow all users to access auto filter
capabilities on the sheet. So, when I password protect it, I check the box
that says allow users to auto-filter. HOWEVER, each of the macros begins and
ends with a password unprotect and password reprotect so that it can complete
some of its functions. So, the problem is when the macro reprotects, it
doesn't allow the auto-filter to be used.

Can you help? Thank you!
 
J

Jim Thomlinson

When the macro protects the sheet there are a number of optional settings
that can be defined. Ensure that this line is included in each protection...

AllowFiltering:=True

So something like
Sheets("Sheet1").Protect AllowFiltering:=True
 

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