Thread: Filter Criteria
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Filter Criteria

Autofilter does not support 3 criteria - only two. You could create a dummy
column that has a formula like

=if(or(C2="P01",C2="P02",C2="BPBT"),"Show","No Show")

then drag fill that down the column and filter on that column.

If P01 and P02 are the only entries that start with P, you could use two
criteria
Critera1:="=P*"
Criteria2:="=BPBT"

--
Regards,
Tom Ogilvy

"desmondleow" wrote in message
...
I need to write a filter criteria with 3 conditions. It seems like my
code doesn't work for 3 criterias. Can somebody help me?

Selection.AutoFilter Field:=12, Criteria1:="=P01", Operator:=xlOr,
Criteria2:="=P02", _
Operator:=xlOr, Criteria3:="=BPBT"

Thanks a lot!

Regards!


---
Message posted from http://www.ExcelForum.com/