Auto filter reset

R

rob nobel

Is there a way within Vba code to reset all the filters before activating
another filter?
What I have currently is:
Selection.AutoFilter Field:=1, Criteria1:=Range("I5")
(Range("I5") refers to a text name.)
But if a filter has been used preceding this procedure, it doesn't show all
the criteria.
When I try a macro to do this, it doesn't work satisfactorily by inserting
it within the procedure.
Rob
 
D

Debra Dalgleish

You can show all the data before applying the new filter:

If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
 
R

rob nobel

Thanks Debra. Works great. I guess it's time to check out all the relevent
properties for an object and I might discover this for myself though I may
not have used the "If ActiveSheet.FilterMode Then" bit.

Rob
 
Top