Results 1 to 6 of 6

Thread: [RESOLVED] Autofilter Criteria limitation / error

Threaded View

  1. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Autofilter Criteria limitation / error

    Quote Originally Posted by Starbucks Junkie
    Guys,

    I am trying to filter on more than 2 sets of criteria but am unable to make the code work, is the code wrong or have I breached the limitation of the filter property?

    Code:
    Selection.AutoFilter Field:=16, Criteria1:="=CN", Operator:=xlOr, _
            Criteria2:="=HK", Operator:=xlOr, _
            criteria3:="=ID", Operator:=xlOr, _
            criteria4:="=IN", Operator:=xlOr, _
            criteria5:="=PK", Operator:=xlOr, _
            criteria6:="=TH", Operator:=xlOr, _
            criteria7:="=TW"
    Let me know, many thanks

    SJ
    On one field you can only use 2 criterias. Have you checked the "Filter by using advanced criteria" option which is also known as "Advanced filter"? you can check it out under Data->Filter->Advanced Filter

    The Advanced Filter command can filter a range in place like the AutoFilter command, but it does not display drop-down lists for the columns. Instead, you type the criteria you want to filter by in a separate criteria range above the range. A criteria range allows for more complex criteria to be filtered.
    Last edited by Siddharth Rout; Apr 17th, 2008 at 09:31 AM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width