+ Reply to Thread
Results 1 to 9 of 9

Autofilter Issue

  1. #1
    Registered User
    Join Date
    06-04-2020
    Location
    Toronto, Ontario
    MS-Off Ver
    2016
    Posts
    20

    Autofilter Issue

    The goal of this macro is to filter for "OFI" OR "WLM" OR "CLOUD" OR "WINDS".

    Problem is that it only filters for "OFI" OR "WINDS".

    How would I get this to include "WLM" and "CLOUD" as well?

    Picture attached.

    Thanks!
    Michael
    Attached Images Attached Images

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Autofilter Issue

    Have you tried adding more xlOr e.g.

    Operator:=xlOr, Criteria2:= "WLM" , Operator:=xlOr, Criteria3:= "CLOUD", ...etc
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-04-2020
    Location
    Toronto, Ontario
    MS-Off Ver
    2016
    Posts
    20

    Re: Autofilter Issue

    Hi Richard,

    I've tried adding that. (attached)
    But I get the error shown.

    Thanks
    Attached Images Attached Images

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

    Re: Autofilter Issue

    Use advanced filter

    Please Login or Register  to view this content.
    Data to be filtered in A1:D13, the field names in row 1 are FieldA,FieldB,FieldC and FieldD
    Filter criteria in J1:J5

    FieldD
    =OFI
    =WLM
    =CLOUD
    =WINDS

    Filtered records to sheet2
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    06-04-2020
    Location
    Toronto, Ontario
    MS-Off Ver
    2016
    Posts
    20

    Re: Autofilter Issue

    Hi Richard,
    I receive an error when doing this.
    (Replied with attachment in thread.)

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

    Re: Autofilter Issue

    @buimichael, you will do as the method only supports up to 2 criteria.

    You will need to use advance filter. More details available here
    https://support.office.com/en-gb/art...8-3f16abdff32b

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Autofilter Issue

    Something like this might also work:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  8. #8
    Registered User
    Join Date
    06-04-2020
    Location
    Toronto, Ontario
    MS-Off Ver
    2016
    Posts
    20

    Re: Autofilter Issue

    Thanks, advanced filter did the trick!

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Autofilter Issue

    You're welcome and thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. autofilter issue
    By displaced in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-01-2016, 06:35 AM
  2. Issue with autofilter
    By kokapelly in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-05-2014, 03:14 PM
  3. VBA AutoFilter issue
    By rowee21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2012, 10:29 AM
  4. AutoFilter Issue
    By ilee10 in forum Excel General
    Replies: 3
    Last Post: 11-28-2008, 06:28 AM
  5. Strange AutoFilter Issue
    By maranello81 in forum Excel General
    Replies: 7
    Last Post: 04-24-2008, 05:16 PM
  6. AutoFilter Issue
    By Kumarrrr in forum Excel General
    Replies: 1
    Last Post: 04-16-2008, 11:16 AM
  7. Database VBA Autofilter Issue
    By Daywalker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2008, 10:58 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