AutoFilter with 3 Criterias

  • Hi guys..
    Need some help here...
    I'm trying to have 3 criterias in 1 autofilter column but it doesnt seems to work..


    This line is working fine...
    Selection.AutoFilter Field:=18, Criteria1:="Current", Operator:=xlOr, Criteria2:="Past Due"


    But I need to add another criteria...
    Selection.AutoFilter Field:=18, Criteria1:="Current", Operator:=xlOr, Criteria2:="Past Due" , Operator:=xlOr, Criteria3:="Complete"


    Why is that so?
    I realise that the custom filter option only allows 2 criterias, is that the cause of it?


    Thanks in advance...
    :(:(

  • Hi RaVon,


    You can only use two criteria because that is all that AutoFilter will accept. You can 'cheat' in VBA by repeating autofilter calls and using the Union method to merge the respective ranges.


    For example:

    HTH

  • Hi there...
    How can i implement Advance Filter through codes?
    Interested to learn.. :yes:


    Quote

    Originally posted by Dave Hawley
    Hi RaVon


    Advanced Filter can take up to 256 criteria

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!