Auto Filter Toolbar Button Does not Toggle

G

Guest

My preference, as far as shortcuts are concerned, mostly involves toolbar
buttons.
There is one to reset all filters to "Show All".
There is one to switch the Auto Filter On,
but there appears to be no Toolbar button to switch Auto-Filter off
completely.
It would make sense to me to be able to use one button to toggle the Auto
Filter.
Is there a way of creating such a button (in VB)?
 
D

Dave Peterson

I cheat.

I select the row with the headers.
I hit the delete key. The data in those header cells is erased and the
autofilter arrows removed.
I hit ctrl-z to put the data back.

Be careful.
 
G

Gord Dibben

Sub Clear_Filter()
On Error GoTo whoops
Selection.AutoFilter
Exit Sub
whoops:
MsgBox "no range selected"
End Sub

Toggles AF on/off


Gord Dibben MS Excel MVP
 

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