I'm looking to filter a column between values but those values are variables within my spreadsheet. Whenever I use this it filters all of the values and nothing is displayed. I'm assuming it's something with the syntax between the ">=" and "<=" in combination with the variables upper_limit and lower_limit but I can't quite figure it out.
Sub Filter_QB_Cost()
'
' Filter_QB_Cost Macro
'
Dim upper_limit As Integer
Dim lower_limit As Integer
upper_limit = Application.Workbooks("Fantasy FB.xlsm").Worksheets("QB Selection").Range("D6")
lower_limit = Application.Workbooks("Fantasy FB.xlsm").Worksheets("QB Selection").Range("D7")
'
ActiveSheet.ListObjects("Table11").Range.AutoFilter Field:=5, Criteria1:= _
">=lower_limit", Operator:=xlAnd, Criteria2:="<=upper_limit"
End Sub
">="&lower_limitnote the use and location of the ampersand.