Filter Criteria

D

desmondleow

I need to write a filter criteria with 3 conditions. It seems like m
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
 
T

Tom Ogilvy

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"
 

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