Creating an Indented Bill of Materials from a Set of Single Level Bills

TimCD

New Member
Joined
Jun 10, 2016
Messages
1
I am currently working on a problem where I need to extract a set of single level bills of materials from an engineering CAD system and then consolidate the set into a single, multi-level indented bill.
I am trying to build an Excel application that will take the set of single level bills of materials (extracted from a CAD system) and assemble them into a fully indented bill of materials for an entire product. The problem is figuring out how to recursively assemble the component sub-assemblies together and also consider that a single sub-assemblies can appear in multiple positions and at different levels in the final assembled bill.
The spreadsheet will comprise of two sheets; an input sheet with the raw CAD input data, and a results sheet with the formatted bill of materials. The input page comprises of the top level bill of materials (Type = Top) and then lists all of the various sub-assemblies referenced in the set (Type = Sub-Assembly), again as single level reports. The result page needs to use the flat sub-assembly lists to expand the top level list out into a fully indented report. It would laso be useful on the results page if the indent level is listed as an integer.
I have attached an example set of data input data and how the result page would look after running the VBA.
If anyone has any idea how to do this, it would be most welcome.

Input


Excel 2012
ABC
1TypeQtyPrt Number
2Top1TOP_LEVEL_ASSEMBLY
31SUB_ASSY_1
41SUB_ASSY_2
5
6
7Sub-AssemblySUB_ASSY_1
81MODULE_01
92PART_001
101PART_002
111MODULE_02
12
13Sub-AssemblyMODULE_01
141PART_003
151PART_004
161MODULE_03
17
18
19Sub-AssemblyMODULE_02
206PART_005
211PART_006
221PART_007
23
24
25Sub-AssemblyMODULE_003
261PART_003
271PART_008
28
29
30Sub-AssemblySUB_ASSY_2
312MODULE_01
321PART_009
332PART_010
341MODULE_004
35
36
37Sub-AssemblyMODULE_004
382PART_003
391PART_011
401PART_012
411MODULE_002
Input


Output

Excel 2012
ABCDEFGH
1QtyLEVELDescription
211TOP_LEVEL_ASSEMBLY
312SUB_ASSY_1
413MODULE_01
514PART_003
614PART_004
714MODULE_03
815PART_003
915PART_008
1023PART_001
1113PART_002
1213MODULE_02
1364PART_005
1414PART_006
1514PART_007
1612SUB_ASSY_2
1723MODULE_01
1814PART_003
1914PART_004
2014MODULE_03
2115PART_003
2215PART_008
2313PART_009
2423PART_010
2513MODULE_004
2624PART_003
2714PART_011
2814PART_012
2914MODULE_002
3065PART_005
3115PART_006
3215PART_007
Result
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Tim,
did you already generate some code of your own? I would run a macro that does the following:
-run through your list (row 2-41) and add the "parent" of each item in e.g. column D
-next, you would ideally have a recursive sub/function to find the "level" of that item/node, could this be of help: http://www.mrexcel.com/forum/excel-...e-totals-using-visual-basic-applications.html
-Finally, once you have those two items, you can put them in the columns you want

Feel free to put some code here (in [ CODE ] brackets please) in case you get stuck,

Koen
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,287
Members
449,149
Latest member
mwdbActuary

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