+ Reply to Thread
Results 1 to 3 of 3

UNFILTER only when filtered

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-31-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    204

    UNFILTER only when filtered

    Hi, I use autofilter in my code as below to add/remove filters..

    Is there a way to modify this, for example if my selection is already unfiltered on below range to just skip it? The problem becomes when my range is already unfiltered and I run the below it just adds the filter for me. I want the below only to unfilter the below range

    Any suggestions? Thanks so much



    LastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
     Range("B16:AD" & LastRow).Select
        Range(Selection, Selection.End(xlToRight)).Select
        Range(Selection, Selection.End(xlDown)).Select
        
          Selection.AutoFilter
    Last edited by donyc; 08-15-2011 at 09:56 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: UNFILTER only when filtered

    You could just use:
    activesheet.autofiltermode = False
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    08-31-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    204

    Re: UNFILTER only when filtered

    sweet.. thanks a lot. that did a trick

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1