#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataFilterAuto Filter in excel 2007? TIJ New Users to Excel 2 November 13th 08 03:28 AM
Excel 2007 Auto Filter Filter Django Excel Discussion (Misc queries) 2 September 9th 08 10:52 PM
Limit filter options in Auto Filter lista72 Excel Discussion (Misc queries) 1 January 23rd 08 04:01 PM
ranging the filter cells when doing auto filter thread Excel Programming 8 April 25th 07 11:08 PM
Excel auto filter doesn't recoginize case - won't filter AA from A Mikey Excel Discussion (Misc queries) 1 September 29th 05 08:18 PM


All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"