ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to allow auto filter after running password protect (https://www.excelbanter.com/excel-discussion-misc-queries/195298-macro-allow-auto-filter-after-running-password-protect.html)

Roady

Macro to allow auto filter after running password protect
 
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!

Jim Thomlinson

Macro to allow auto filter after running password protect
 
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
--
HTH...

Jim Thomlinson


"Roady" wrote:

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!



All times are GMT +1. The time now is 03:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com