I am trying to autofilter a range with an array that I declared from a different range, but the autofilter will only use the last value of the array as criteria.
For instance, Range("B6:B10") contains the data with which I want to filter Range("A1:A114"), but my range is only filtered by what is in Range("B10"). This code is part of a much longer piece of code and the range which contains my filter criteria will be dynamic. The code is posted below.
For instance, Range("B6:B10") contains the data with which I want to filter Range("A1:A114"), but my range is only filtered by what is in Range("B10"). This code is part of a much longer piece of code and the range which contains my filter criteria will be dynamic. The code is posted below.
Code:
Sub Test()
Dim Array1 As Variant
Array1 = Application.Transpose(SampleResults.Range(SampleResults.Range("B6"), SampleResults.Range("B6").End(xlDown)))
RawData.Columns(1).AutoFilter Field:=1, Criteria1:=Array1
End Sub