+ Reply to Thread
Results 1 to 5 of 5

Excluding items from filter

  1. #1
    Registered User
    Join Date
    11-03-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Excluding items from filter

    Hi,

    a common VBA problem, I reckon, but I can't find any answers that fit that well.

    The problem: I have a filter that has maybe 50 unique values and I want to omit just one of them. Is there a simple way of doing this (I know how to set one or a few in VBA - do I have to use a loop of some kind to set them all and just omit the one I don't want?)

    Thanks
    Last edited by ij1001; 11-29-2011 at 07:40 AM.

  2. #2
    Registered User
    Join Date
    11-03-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Excluding items from filter

    I'm finding the terminology difficult on this one. What I want is a way to switch all filters to allow data through (unfiltered) except for one. There are 50 or more potential filters and I don't want to manually set all of them to checked except for one:

    Column A
    =======
    AAA
    BBB
    CCC
    DDD
    EEE
    FFF
    ...
    ZZZ

    In the example above, using VBA, how can I allow all data to be selected except for, say, CCC without hard coding so after the filter is applied it looks like:

    Column A
    =======
    AAA
    BBB
    DDD
    EEE
    FFF
    ...
    ZZZ

    Hope this makes sense!

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Excluding items from filter

    Posting a sample workbook would make sense.

    Please Login or Register  to view this content.



  4. #4
    Registered User
    Join Date
    11-03-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Excluding items from filter

    Hi,

    couldn't get that to work - please see attached sheet. Sheet1 (abc) is unfiltered, Sheet2 (def) has CC filtered out - can you show me how to do this in VBA with that example please?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-03-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Excluding items from filter

    Sorted - you're code did work (of course) - thanks

+ 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