View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] david.j.winfield@gmail.com is offline
external usenet poster
 
Posts: 25
Default vba autofilter two columns

I would like to be able to filter a sheet based off of two columns in
VBA. If I run the following one at a time I can filter based off the
one column, but if I run them both it will not work.

Worksheets("Master Index").Range(Cells(12, 42), Cells(65536,
42)).AutoFilter field:=1, Criteria1:="E", Operator:=2, Criteria2:="M/
E"

Worksheets("Master Index").Range(Cells(12, 163), Cells(65536,
163)).AutoFilter field:=1, Criteria1:="1", Operator:=2, Criteria2:="1"

Also, what is the field option used for?

Thank you for your help,
David