Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

autofilter

  Asked By: Kevin    Date: Aug 25    Category: MS Office    Views: 692
  

I need a way to remove all autofilters on a page. Sometimes I have them
and sometimes I don't and I keep running into problems with that on the
page so I need a way to clear it, even if it is not there. I tried
autofilter.false and autofilter.clear and nothing seems to be kicking
in.

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Daimon Jones     Answered On: Aug 25


This should turn autofilter  on and off.

Sub Filter()
Rows("1:1").Select
Selection.AutoFilter
End Sub

 
Answer #2    Answered By: Aabirah Khan     Answered On: Aug 25

You might want

ActiveSheet.ShowAllData

 
Answer #3    Answered By: Utsav Shah     Answered On: Aug 25

Yes that does turn it on and off but that would turn it off when it is
on and on when it is off. That is the code I am currently using. The
problem is that sometimes there is an autofilter  already active on the
worksheet. Sooooo I need to turn it off when it is on and do nothing
when it is off. Also, because there are multiple tables on this one
worksheet the autofilter might be active on a different table than the
one I want to deal with so just using Activesheet.showalldata does not
work 100% of the time.

 
Answer #4    Answered By: Ziza Mizrachi     Answered On: Aug 25

Oh hey I figured this one out. Thanks to Derek Rose and his link he
sent me about pivot tables I also found a treasure of information about
anything excel and they had a section on autofilter  coding. It ended up
being selection.autofilter = false. Thanks Derek. In case anyone else
is interested the link is



http://www.contextures.com/tiptech.html

 
Didn't find what you were looking for? Find more on autofilter Or get search suggestion and latest updates.




Tagged: