What is the syntax to autofilter?

Sheets(“<sheet's name>”).Range(“<range of filtered data>”).AutoFilter Field:=<column of data> Criteria1:=<filter value>
‘example
'In worksheet Closet, filters 100 rows in column A for values containing Dresses
Sheets(“Closet”).Range(“A1:A100”).Autofilter Field:=1 Criteria1:=“Dresses”


'example
'to filter a list by sales from "north" region
Sheets("salesdata").Range("B1").AutoFilter field:=3, Criteria1:="North"

 

 

 

Advertisements