Auto filter reset

  • Thread starter Thread starter rob nobel
  • Start date Start date
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
 
You can show all the data before applying the new filter:

If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
 
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
 

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

Similar Threads


Back
Top