+ Reply to Thread
Results 1 to 3 of 3

How can I add a 3rd AutoFilter Variable in a Macro?

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    84

    How can I add a 3rd AutoFilter Variable in a Macro?

    In my macro I call for a filter to exclude 2 values so they aren't deleted in the next step. Currently the code looks like this:

    Please Login or Register  to view this content.
    Is there a way to exclude a 3rd/4th excluded value if I want? I know one option would be to reverse this and set the filter to array to equal every value BUT the ones I'm interested in. I'm curious if there is an easier way. I'm only excluding 2-3 values and including the other 40 or so. I tried playing around with adding an additional "And" statement to the code but didn't get it to work. I also tried setting it up as an array for the items is DOESN'T equal but either did something wrong or that doesn't work either.

  2. #2
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: How can I add a 3rd AutoFilter Variable in a Macro?

    I think you can approach this by using advanced filter

    e.g.

    Please Login or Register  to view this content.
    You need to specify all the values for which you want to filter in a separate column, though. The separate column must have the same header as the column to be filtered. Otherwise advanced filter won't work
    Liked the answer given? click * to say so

  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    84

    Re: How can I add a 3rd AutoFilter Variable in a Macro?

    That may be an option, but seems like it would be as complicated as my choices right now with the way the macro works. As it stands right all I'm really doing is filtering to exclude a couple of values (Departments in this case) and then deleting all other rows in the worksheet before moving to the next worksheet. Was hoping there was a simple way to just add additional exclusions, but if not can still work with what I have. I think more than anything I'm trying to learn efficiencies at the moment.

+ 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