I would like to make a code which would filter out the Purchase Order (6-digit numbers) numbers based on a certain range of these numbers.
I have 2 sheets in my workbook. The first one, called "Start", includes the numbers in range A1:A4, namely 180029, 180298, 181073, 190152. On the second tab, called PO list, I have a range of information - 15 columns, 23 rows. One of the columns of the PO list contains several PO numbers, but I would like to filter out only the ones that are in the range A1:A4 - which I considered as an array.
Sub auto_filter()
Dim my_array() As Variant
my_array = Sheets("Start").Range("A1:A4").Value
Sheets("PO list").Range("A1").AutoFilter Field:=7, Criteria1:=my_array
'Operator:=xlFilterValues
I expect to have the result that the PO numbers from range A1:A4 will be filtered out on the tab PO list. The code, that I wrote, only filters out the the PO number 190152 - the other three are omitted.