Shortcut to show all after filtering?

R

Roger Dodger

Is there a shortcut to getting the filter boxes to show all? I am creating a
series of macros to run a combination of filters. When I'm finished I am
left with a partial amount of data. Currently I have to manually show all in
each column before I start a new filter sequence. Can this be done a better
and faster way?

Thanks in advance
Kevin
 
H

HBj

' Keyboard Shortcut: Ctrl+f
'
' Go to the heading row:
Range("A1").Select
If Selection.AutoFilter Then Selection.AutoFilter
 
D

Dave Peterson

If you're using xl2003 or below, you could add an icon to your favorite toolbar.

Tools|Customize|Commands tab|Data Category
And drag "Show All" and maybe "Autofilter" to that favorite toolbar.

xl2007+ has the filter button on the ribbon under the Data group (if I remember
correctly).

In code, you could use something like:

dim wks as worksheet
set wks = worksheets("Somesheetname")
with wks
'show all the data
If .FilterMode Then
.ShowAllData
End If
end with
 
D

Don Guillett Excel MVP

If you're using xl2003 or below, you could add an icon to your favorite toolbar.

Tools|Customize|Commands tab|Data Category
And drag "Show All" and maybe "Autofilter" to that favorite toolbar.

xl2007+ has the filter button on the ribbon under the Data group (if I remember
correctly).

In code, you could use something like:

dim wks as worksheet
set wks = worksheets("Somesheetname")
with wks
    'show all the data
    If .FilterMode Then
       .ShowAllData
    End If
end with

You could always just unfilter when finished with the filter>copy. Use
the range. Here is one I did for a client to filter>copy to another
location and unfilter.

With ss.Range("a1:z" & lr)
For i = 1 To Cells(3, Columns.Count).End(xlToLeft).Column
.AutoFilter Field:=2, Criteria1:=Cells(1, 1)
.AutoFilter Field:=3, Criteria1:=Cells(3, i)
ss.Range("a2").Resize(lr).Copy Cells(4, i)
Next i
..AutoFilter
End With
 

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