Creating a BOM Heirarchy using VBA

blakecw3

New Member
Joined
Nov 15, 2017
Messages
1
Hello,

I'm trying to take a list of items and components and create a heirarchical Bill of Materials from the data sample shown here. The total list will be for 12000+ rows.

ABCDE
1
Item NumberUOMComponentComponent UOMQuantity
2CPT001AEAFPM1010RMS0.19
3CPT0002AEA
4CPT005AEAFPM15XRMS0.17
5CPT010AEAFPM3010RMS0.19
6CPT00122CYFNEACPT001EA2
7CRE00562NNNNEA
8MME3S01613VPEA21334EA13
9MME3S01613VPEA10105EA3
10MME3S01613VPEA992EA2
11MME3S01613VPEA10114EA2
12MME3S01613VPEA985EA2
13MME3S01613VPEA984EA2
14MME3S01613VPEA982EA1
15MME3S01613VPEA980EA1
16982EA323LB1.75
17984EA
18985EA

<tbody>
</tbody>


In column A, an item number may or may not have a corresponding component in column C. I want to create a new array in a separate worksheet where the component is matched with the Item Number and the quantity is shown for each level in the BOM in a table of conversions. If there is no component value, then it should be skipped in the list. Note that there can be multiple components for a given Item Number and the list should repeat with each item number and component pairing on a separate line. If the Item Number does have a component, the component value will have to be searched in the item number column to find its subcomponent in the BOM. The BOM can go as high as 8 levels of subcomponents and can have as many as 8 components for each Item Number. The example results would look something like the following:

ABCDFGH
1Item NumberComponent 1Component 2Component 3Quantity Item --> Component 1Quantity Component 1 --> Component 2Quantity Component 2--> Component 3
2CPT001AFPM1010R0.19
3CPT005AFPM15XR0.17
4CPT010AFPM3010R0.19
5CPT00122CYFNCPT0012
6MME3S01613VP2133413
7MME3S01613VP101053
8MME3S01613VP9922
9MME3S01613VP101142
10MME3S01613VP9852
11MME3S01613VP9842
12MME3S01613VP98232311.75
13MME3S01613VP9801

<tbody>
</tbody>


Thank you for your review.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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