Finding multiple rows from table in external workbook with criteria in 2 columns

GeorgeThalassinos

New Member
Joined
May 23, 2013
Messages
1
I have a workbook where the user inputs an Item Code and I want to present them with a list of LOT numbers (from a Table existing in another workbook) to choose from. The list will then be used in a list box so I would like the result in an array.

So my input is an Item Code (I am not sure if it is a string or a number yet) and with that I need to select all the LOT numbers in the external table where ItemCode=InputValue (variable, first criterion) and Status = 5 (fixed value, second criterion) and load an array with the results from the LOTnumber column. In the following example this would be {10005, 10007}.

The table is an Excel 2010 TABLE object

Book Test.xlsm

range("C_INPUTVALUE").value = 4007221031383

Book PROD.xlsm

Table PROD.xlsm!T_PRODUCTION[#Data]

fld1ItemcodeItemdescLOTnumberStatus
q
28030100

<colgroup><col></colgroup><tbody>
</tbody>
item1

<colgroup><col></colgroup><tbody>
</tbody>
10001

<colgroup><col></colgroup><tbody>
</tbody>
8

<colgroup><col></colgroup><tbody>
</tbody>
q4007221031383item2100046
q4007221031383item2100023
q4007221031383item2100055
wt4007221031383item2100075
ret4007221031383item2100039
3428030100item1100081
224007221031383item2100061
44007221031383item2100091

<tbody>
</tbody>




<colgroup><col><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>
I know how to do this with loops but I would like to find a way using objects. I am just starting with them but I see that there is an advantage there.

Any help will be greatly appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,215,066
Messages
6,122,947
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top