Simple macro - show all data

N

Neil

Hi,

I use filters alot in excel but am tired of clicking "Data" ,
"Filter", "show all" to clear my previous filter selections.

Have tried recording a macro to execute in one hit to no avail.

Can anyone help with a sugestion, Code or keyboard shortcut.

Thanks in advance

Neil
 
T

Trevor Shuttleworth

Neil

recording the actions gives:

Selection.AutoFilter ' switch on AutoFilter
Selection.AutoFilter Field:=3, Criteria1:="2" ' select value "2" in
Column 3
ActiveSheet.ShowAllData ' show all data

So, try something like this and attach it to a button:

Sub afShowAll()
ActiveSheet.ShowAllData ' show all data
End Sub


Regards

Trevor
 
T

Tim

it may depend upon your version of Excel, but in 2002, there is a button you
can add already built in.

right click in the toolbar area > customize > Commands > Data > drag the
Show All button to a toolbar

it works for me!
 
Top