single click to deactivate Auto Filters? How?

B

bkee62

Is there a way to have a icon or button in a tool bar that turns off
auto filters? I made a toll bar with Auto Filter and Show All but can
not find a way to turn off the filters with out going manually to the
main menu, then Filters and unchecking Auto Filter.
 
A

Andy B

bkee62

This is a macro I was sent to do the job.

Sub Autofilter()
Selection.Autofilter
End Sub

Andy.
 
P

Peo Sjoblom

I use this on a file at work attached to a button from the forms toolbar

Sub Reset_Filter()
Application.ScreenUpdating = False
For Each sh In Worksheets
If sh.FilterMode Then
On Error Resume Next
sh.ShowAllData
End If
Next
Range("A1").Select
Application.ScreenUpdating = True
End Sub

You can skip the selection of A1 if you want


This will still leave the autofilter, to turn it off
completely you will need

ActiveSheet.AutoFilterMode = False
 

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