Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto Filter
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto Filter
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. -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "Sandy" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto Filter
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 "Wigi" wrote: 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. -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "Sandy" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
DataFilterAuto Filter in excel 2007? | New Users to Excel | |||
Excel 2007 Auto Filter Filter | Excel Discussion (Misc queries) | |||
Limit filter options in Auto Filter | Excel Discussion (Misc queries) | |||
ranging the filter cells when doing auto filter | Excel Programming | |||
Excel auto filter doesn't recoginize case - won't filter AA from A | Excel Discussion (Misc queries) |