I have a table, and I would like to filter rows by values ββin one of my columns. The values ββused for filtering are stored in a separate column that is not contained in the table. This is what I still have:
Dim table1 As ListObject
Dim range1 As Range
Set range1 = ActiveSheet.range("AM23:AM184")
'get table object
table1.range.AutoFilter Field:=3, Criteria1:=???
I do not know what to put according to the criteria1. I know that it must be an array, and I can set it as something like Array ("12", "2", "13"), but I need it to equal the values ββspecified in the range given by range1. Any help would be greatly appreciated.
EDIT: I managed to get the range values ββin the array by doing range1.Value and then converting Variant to an array of strings. This did not work as I wanted, as it just sets my filter to the last value in my array. For example, if my array contains identifiers ("12", "44", "13", "22"), and I install Criteria1 into this array and run it, the filter has only 22, and all other numbers are canceled, including 12, 44 and 13.
source
share