Protections

dtaylor

Active Member
Joined
Mar 21, 2002
Messages
379
Hello All,
I have searched for this and come up with nothing.

Is it possible to have autofilters on and also have protection. Having autofilters on and then protecting a sheet seems to lock the autofilters.

Any suggestions????

Thanks

Dan
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Private Sub Worksheet_Activate()
'the enableautofilter is reset each time you select the sheet
Me.Protect Password:="password", UserInterFaceOnly:=True
Me.EnableAutoFilter = True
End Sub
 
Upvote 0
Of course, in XP this is much easier, but the following macro protects the sheet and also enables the autofilter (It must be turned on before running it)<pre>Sub ProtectAndFilter()
With Sheets("Sheet1")
.Protect "Password", , , , True
.EnableAutoFilter = True
End With
End Sub</pre>
 
Upvote 0
Even easier !

When you go into protection and protect the sheet you have a lot of tick boxes yes ?

Simply go down near the bottom and select allow user to use the autofilter !

Why does everyone seem to try and do it in VBA ? I have done VB but trying to show some newbies to Excel VB Script is not the easiest of things when it can be done without ! Im whining at anyone as youve helped me out a few times here but i simply wanted to state that if i was fresh to it and i had VB code given to me id probably just give up!

Anyhow feller i hope this helps too ...
 
Upvote 0
Hi Mike,
Thanks for the heads up!

Well let me tell you why I want to do this in vba. I support a large number of associates in the entire western us and the sheer amount of time it takes to format 700 (or 1000 or 1500 depending on what I doing) files is not worth the effort for autofilters. My entire process is automated and would rather not have one piece not automated.

My files at the end of the process do not contain vba (just to many issues with whinny people)but do contain many formulas which I want to protect from the end user.

If I cannot provide autofilters and possibly sort then I cannot send the files out with protections.

I tried the above suggestions but they only work when the module is present. I ran my file with this code, and yes it did apply the autofilters but without the module they where locked.

Thanks

Dan
 
Upvote 0

Forum statistics

Threads
1,223,941
Messages
6,175,537
Members
452,652
Latest member
eduedu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top