+ Reply to Thread
Results 1 to 3 of 3

Advanced Filter using Criteria Range not picking up all criteria

  1. #1
    Registered User
    Join Date
    04-14-2021
    Location
    Long Island, NY
    MS-Off Ver
    Office 365
    Posts
    37

    Advanced Filter using Criteria Range not picking up all criteria

    Hi All,

    I've inherited a block of code and needed to change the front ends column structure, thus requiring me to update some of the code. However, when I was finished updating everything, my Advanced Filter using the Criteria Range wasn't picking up all of the criteria needed.

    Process: in the Drivers tab, when I run the "Update Drivers" macro button in the first row, the code is suppose to reference the "Advanced Filters" sheet (A2:B5), then cycle through the "P MFI" sheet. When it gets to the "P MFI" sheet, based on the criteria, its suppose to copy and paste (to the Drivers sheet) any row that has an "A/a" (found in column A) or if the "Prob %" field (found in Column I) is either 90 or 100.

    Issue: When I execute the Drivers Update macro button, only rows that have an "A/a" are copied and pasted into the Drivers sheet.

    Example: Go to the Drivers sheet, run the "Update Drivers" macro button and you'll notice that only Company 2 and Company 8 are copied over (including placeholders which are not a part of this troubleshooting session). The solution would include Companies 1, 6 and 10 (in addition to the rows that have an A/a), which do not have an "A/a" in the first column, but do have a Prob % of either 90 or 100.

    The code is located in the Drivers_Update module in the attached file. I've also screenshot the exact line of code that is using the Advanced Filters Criteria Range functionality.

    Again, the three sheets that you'll need to use in troubleshooting are "P MFI", "Drivers", and "Advanced Filters".




    Your help will be most appreciated, as I am at a complete loss!

    Thank you very much,

    Kenneth
    Attached Files Attached Files
    Last edited by knykil; 06-11-2021 at 10:27 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Advanced Filter using Criteria Range not picking up all criteria

    Have you tried manually filtering the data using your criteria? Do you get the records you expect?

    First the Prob (%) field name has a line feed in it, so the field is not being found. Make sure the column header text is identical.
    The numeric values should not use wildcards. either =100 or =>100 depending on what you actual mean by *100*
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    04-14-2021
    Location
    Long Island, NY
    MS-Off Ver
    Office 365
    Posts
    37

    Re: Advanced Filter using Criteria Range not picking up all criteria

    Thanks, Andy!! This was exactly what I needed. Such a simple error that I overlooked.

    Cheers,
    Kenneth

+ 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. Advanced filter with function as criteria range?
    By dakke in forum Excel General
    Replies: 23
    Last Post: 06-10-2021, 04:48 PM
  2. [SOLVED] Advanced Filter Code : Criteria Range More Than 1 Row Breaks Filter
    By PaulGW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2021, 04:30 PM
  3. Dynamic criteria range with advanced filter
    By shoun2502 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2021, 04:29 PM
  4. Advanced Filter Criteria Range Help
    By JoeGio25 in forum Excel General
    Replies: 0
    Last Post: 10-23-2011, 07:34 PM
  5. Advanced Filter - Criteria Range Issue
    By EB78 in forum Excel General
    Replies: 0
    Last Post: 06-27-2008, 05:38 PM
  6. Advanced Filter VB Script for Variable Criteria Range
    By Jason in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2006, 02:15 AM
  7. Advanced filter and Criteria Range
    By gearoid in forum Excel General
    Replies: 2
    Last Post: 07-20-2005, 10:05 AM

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