This Excel macro allows you to filter a data set on multiple columns and criteria at once. This means that you can filter the data based on values in column A and then Column B etc. You can also have separate criteria for every column. This allows you to be able to narrow your data sets down to just exactly what you need to view; this is similar to a drill-down approach.
This is a really useful filtering macro in Excel and it is pretty straightforward in terms of its use. Currently there are two lines in the macro and they are almost identical except for the field which is being filtered. To filter more fields or columns simply copy and paste this line in the macro (Range("A1").AutoFilter Field:=2, Criteria1:="Enter Criteria Here" ) and change the field number and the criteria. That is all you have to do to filter more than two columns at once. Just make sure that you replace "Enter Criteria Here" with your own criteria and that you change the field number to the desired field number with every new autofilter.
All of the elements below often appear within autofilter macros.
Range
Field
Criteria
Operator
Sub AutoFilter_in_Excel_Multiple_Col_Filter()
Range("A1").AutoFilter Field:=1, Criteria1:="Enter Criteria Here"
Range("A1").AutoFilter Field:=2, Criteria1:="Enter Criteria Here"
End Sub