Auto Filter

S

Sandy

I am trying to use a multi criteria filter with...

ActiveSheet.Range("$A$1:$AI$86").AutoFilter Field:=9, Criteria1:="<>CAT", _
Operator:=xlAnd, Criteria2:="<>DOG", Operator:=xlAnd, Criteria3:= _
"<>BIRD", Operator:=xlAnd

But I am getting Application defined error. I supose its because there is
more than 2 criteria. Do i need to add a second line like this one with the
3rd cruiteria or is there a way to combine into one line?

Thanks
 
W

Wigi

in the Autofilter, you can only filter on 2 elements in 1 column.

Either you use an advanced filter (recommended)
Either you add an extra column where you duplicate data, but where you're
able to filter further.
 
S

Sandy

OK.... But if I record a macro while filtering and unselecting all but Dog,
Cat, Bird I get...
ActiveSheet.Range("$AB$16:$AB$39").AutoFilter Field:=1, Criteria1:=Array( _
"Dog", "Cat", "Bird"), Operator:=xlFilterValues

can tbis type of statement not be modified to <> ?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top