This free Excel macro filters data to display only those records or rows that contain a value between two values. For example, you could display all of the salesmen whose sales are between $50,000 and $75,000 for the quarter. You can use any number and apply it to any data set that contains number where you need to display all of the records that are within a certain range.
To use this macro, just replace "50000" with the number you want to use for the lower end of the range and replace "75000" with the number that you would like to use for the upper end of the range. Make sure to leave the ">" and "<" in place because this is what makes the macro work.
All of the elements below often appear within autofilter macros.
Range
Field
Criteria
Operator
Sub AutoFilter_in_Excel_Above_Below_Num()
'This autofilter macro displays records with a number between 50000 and 75000 within the first field - in this case in column A
'It is important to retain the ">" and "<" signs within this macro because that it what makes this work correctly
Range("A1").AutoFilter Field:=1, Criteria1:=">50000", Operator:=xlAnd, Criteria2:="<75000"
End Sub