autofilter

L

Loko

Hello

Dear friends - Maybe You can tell me how Can I "force " ms excel to
use more than two Criteria fileds in autofilter /under VBA / ??
Now I have something like this :
Selection.AutoFilter Field:=1, Criteria1:="=*GW" Or "=*GWRL",
Operator:=xlAnd

but I need to put one or two Criteria in this filter.

Regards for everyone
Loko
 
C

CLR

In XL97, I use something like this.....

Selection.AutoFilter
Selection.AutoFilter Field:=3,
Criteria1:=Worksheets("Sheet1").Range("c2").Value
Selection.AutoFilter Field:=25,
Criteria1:=Worksheets("Sheet1").Range("Y2").Value
Selection.AutoFilter Field:=21,
Criteria1:=Worksheets("Sheet1").Range("i2").Value, _
Operator:=xlAnd, Criteria2:=Worksheets("Sheet1").Range("j2").Value


hth
Vaya con Dios,
Chuck, CABGx3
 
D

Dave Peterson

Maybe it's time to learn about data|filter|advanced filter.

Debra Dalgleish has some notes:
http://www.contextures.com/xladvfilter02.html

Another (cheating?) option that I use is to insert a new column and add a
formula to that column of cells that evaluates to what I need (usually
true/false). Then I just filter on that column.
 
Top