This free Excel macro filters data in Excel based on multiple criteria for one field in the data set. This macro uses the autofilter feature and specifically filters data based on two separate criteria. This allows you to narrow down a data set based on more than one parameter and to better display specific sets of data within Excel.
The two criteria are listed as "Criteria1" and "Criteria2" and in order to change what is filtered, just replace the "Enter Criteria Here" text with your own text, characters, or numbers.
All of the elements below often appear within autofilter macros.
Range
Field
Criteria
Operator
Sub AutoFilter_in_Excel_AND_Operator_One_Field()
Range("A1").AutoFilter Field:=1, Criteria1:="Enter Criteria Here", Operator:=xlAnd, Criteria2:="Enter Criteria Here"
End Sub