hi,
yes you can.
from the tool box, drag a command button to your sheet. right click and
select properties. give it a name. maybe your filter. close the property
window.
Right click the button and select view code. it should have sub with the
click event and end sub. paste this between the sub and end sub
Range("A1").Select
Range("A1").AutoFilter
Range("A1").AutoFilter Field:=X, Criteria1:="YourCriteria"
first line -the curser has to be within the data range hence A1 select or
this fails.
the second line turns autofilter on.
the third line is the filter where field=X is the column count number.
instead of A,B,C,D... use column numbers 1,2,3,4, ect.
you can to a double filter. just add a fourth line with the column number
and criteria.
You may want an "unfilter" button. autofilter is boolean meaning on or off.
if autofilter is on, the code to turn it off would simple be...
Range("A1").autofilter
if autofilter is off, the above command turns in on. if it is on, the above
command turns it off.
for more info, open the VB editor(Alt+F11) and click help>type autofilter
hope is helped
Regards
FSt1