Auto-filter toolbar icon

P

Paul Cunliffe

Is there a way of getting the toolbar icon for auto-filter to toggle
the feature on or off? It only seems to switch it on then I have to
navigate through the menu (ok, not that much of a hardship!) to switch
it off again.

TIA

Paul
 
D

Debra Dalgleish

You could attach a macro to that button, with code to toggle the
AutoFilter on and off.

If you store your macro code in a workbook that is always open, such as
Personal.xls, and you can use it in any workbook.

For example:

Sub ToggleFilter()
On Error Resume Next
Selection.AutoFilter
End Sub
 
G

Gord Dibben

Paul

I assigned this code to a button. You coulk assign it to the Default
Autofilter button.

Turn Autofilter on/off.

Sub AutoFilter()
With ActiveSheet
ActiveCell.Select
Selection.AutoFilter
End With
End Sub

Gord Dibben 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