Coming from the question Excel macro filter based on multiple cell values and using the answer from Creating an Array from a Range in VBA
I was trying to create an autofilter for a wide range using an array. However, it keeps using only the latest value in the range of the array.
How can I use all of the values in the filter?
Sub Test()
Dim DirArray As Variant
DirArray = [A2:A5].Value2
ActiveSheet.range("$B$1:$C$10").AutoFilter Field:=2, Operator:=xlFilterValues, Criteria1:=DirArray
End Sub