You can control autofilters from VBA. For instance, these two lines from
one of my spreadsheets:
Call Selection.AutoFilter(Field:=4, Criteria1:="<=30-Jun-2006")
Call Selection.AutoFilter(Field:=10, Criteria1:="=")
These set a date filter on column 4 and an "empty" filter on column 10.
The following clears any filters (i.e. "show all")
With ActiveSheet
If .FilterMode Then
Call .ShowAllData
End If
End With
Note that I don't explicitly define a Selection for the AutoFilter - as long
as the correct sheet is current it seems to work OK. AutoFilter needs to
have been associated with the relevant columns first, of course.