Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Filter Criteria (Excel 2002)

    I have the following code and was wanting to add a THIRD criteria (it didn't work)... when doing a filter manually a third criteria is not possible... is this also the case in VBA??
    Sheet9.Select
    Range("A1:L1").Select
    Selection.AutoFilter
    Selection.AutoFilter Field:=2, Criteria1:="75CSLSNA"
    Selection.AutoFilter Field:=11, Criteria1:="=JACK", Operator:= _
    xlOr, Criteria2:="=JANE", Criteria3:="=JOE"

    Thanks!
    Lana

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter Criteria (Excel 2002)

    If you click in the word AutoFilter in the Visual Basic Editor and press F1, you'll see that it has arguments Criteria1 and Criteria2, but not Criteria3.

    If you need to specify more than two criteria, you can use Advanced Filter with a criteria range, both interactively and in code.

Posting Permissions

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