+ Reply to Thread
Results 1 to 5 of 5

Auto Filter with Multiple Criteria

  1. #1
    Registered User
    Join Date
    08-14-2019
    Location
    California
    MS-Off Ver
    2013
    Posts
    2

    Auto Filter with Multiple Criteria

    Hello everyone,

    I've been searching but I have yet to find code that works properly. I am attempting to filter two columns based on two sets of criteria:
    -Criteria 1: Based on date based on cell B19 of another worksheet
    -Criteria 2: Based on any of a set of values

    I am able to sort appropriately on Criteria 1 with the below code. Though Criteria 2 is not working for me.
    I am by no means wed to the below approach for filtering (meaning, if we could hard code the values that should be filtered, I am OK with it).

    Please Login or Register  to view this content.
    Any ideas for how I can get this to work?

    Thanks!
    Last edited by JEdwards1; 08-14-2019 at 02:10 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Auto Filter with Multiple Criteria

    Quote Originally Posted by JEdwards1 View Post
    -Criteria 2: Based on any of a set of values
    Can you better explain what Critera2 is and the nature of the data in column F?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Auto Filter with Multiple Criteria

    Try someting like this. Not Tested and made assumptions about what you are wanting to filter.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-14-2019
    Location
    California
    MS-Off Ver
    2013
    Posts
    2

    Re: Auto Filter with Multiple Criteria

    Quote Originally Posted by AlphaFrog View Post
    Try someting like this. Not Tested and made assumptions about what you are wanting to filter.

    Please Login or Register  to view this content.
    Thanks so much for the help, AlphaFrog. The first filter works perfectly, but the second one filters out everything.

    The source data for the second criteria is a numerical list within cells A1:A7 of the "Source Range" spreadsheet (e.g., 1234, 4321, 1111, 0000, etc.). The filtering criteria should be an OR as opposed to an AND (e.g., 1234 OR 4321 OR 1111, etc.).

    Any ideas why the second filter isn't working?

    Thanks for the help!

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Auto Filter with Multiple Criteria

    Try this.
    The numbers list in A1:A7 must be formatted the same as the numbers in column F
    The numbers will be filtered as OR

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Vba macros to auto filter on multiple criteria from another sheet
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-07-2018, 11:54 PM
  2. Auto Filter with allowing selection of multiple criteria across more than 1 field
    By rockobinks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2017, 09:00 PM
  3. [SOLVED] Add multiple criteria to auto filter one by one via loop from a range / array
    By Ronnet2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2016, 07:25 AM
  4. [SOLVED] Multiple criteria Auto Filter
    By igormigor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2015, 03:42 AM
  5. [SOLVED] Macro to hide rows (Auto filter) based on multiple criteria
    By pauldaddyadams in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-03-2014, 07:36 AM
  6. VBA Code for Multiple criteria auto Filter & sending the mails based on that
    By Rajveer1981 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2012, 01:37 PM
  7. Multiple Criteria Using Auto Filter
    By mattydalton in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-06-2010, 02:11 PM

Tags for this Thread

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