I want to use autofilter in vba to filter using a dynamic range of cell values.
ActiveSheet.Range("$A$1:$I$954092").AutoFilter Field:=1, Criteria1:=???? _
Operator:=xlFilterValues
I want to use a dynamic range of cells like
Range("A1",Range("A1").End(xlDown))
Can you suggest how to specify this?
I have tried passing the following to Criteria1:
Range(###).Value
Array(Range(###))
etc.
Ex.
Col1 Col2 Col3 Col4
----------------------------
A 1 3 Y
B 3 3 N
A 2 2 N
C 6 1 Y
B 9 3 Y
I want to filter out the rows with values A
& C
in Col1
.
Col1
and underneath it putA
andC
in the next rows. Now select advanced filter on your data and in filter criteria put the whole thing, with the column header. – xificurC