# How do I create a multi-level bill of materials from a single level BOM table?

#### EinarG

##### New Member
Starting with this Single Level BOM table (Windows 7 Pro, Excel 2013). "Qty Per" refers to the quantity of the child needed in the Parent:

 Parent Child Qty Per PART-A PART-A1 1 PART-A PART-A1121 5 PART-A PART-A2 2 PART-A PART-A222 4 PART-A1 PART-A11 2 PART-A11 PART-A111 1 PART-A11 PART-A112 2 PART-A112 PART-A1121 1 PART-A112 PART-A1122 2 PART-A2 PART-A21 1 PART-A2 PART-A22 2 PART-A2 PART-A221 3 PART-A22 PART-A112 4 PART-A22 PART-A221 1 PART-A22 PART-A222 3 PART-B PART-A1 2 PART-B PART-A21 3

<tbody>
</tbody>

I need (a Macro) to generate the exploded (or stacked) table below. As an example doing this manually for the Grand Child, the process went like this:

1. For each single level BOM Parent/Child row (R), find # grand children rows (N)
2. Copy entire row (R) and insert N-1 copies below row R (Note: if N=1, no copy/insert is required)
3. Find grand child(ren) for each child and corresponding Qty Per in the single level BOM Table and copy/paste into Grand Child / Grand Child Qty per columns
4. Repeat steps 1-3 for Great Grand Children and Great Great Grand Children

 Parent Child Child Qty Per Grand Child Grand Child Qty per Great Grand Child Great Grand Child Qty Per Great Great Grand Child Great Great Grand Child Qty Per PART-A PART-A1 1 PART-A11 2 PART-A111 1 PART-A PART-A1 1 PART-A11 2 PART-A112 2 PART-A1121 1 PART-A PART-A1 1 PART-A11 2 PART-A112 2 PART-A1122 2 PART-A PART-A1121 5 PART-A PART-A2 2 PART-A21 1 PART-A PART-A2 2 PART-A22 2 PART-A PART-A2 2 PART-A22 2 PART-A112 4 PART-A1121 1 PART-A PART-A2 2 PART-A22 2 PART-A112 4 PART-A1122 2 PART-A PART-A2 2 PART-A22 2 PART-A221 1 PART-A PART-A2 2 PART-A22 2 PART-A222 3 PART-A PART-A2 2 PART-A221 3 PART-A PART-A222 4 PART-A1 PART-A11 2 PART-A111 1 PART-A1 PART-A11 2 PART-A112 2 PART-A1121 1 PART-A1 PART-A11 2 PART-A112 2 PART-A1122 2 PART-A11 PART-A111 1 PART-A11 PART-A112 2 PART-A1121 1 PART-A11 PART-A112 2 PART-A1122 2 PART-A112 PART-A1121 1 PART-A112 PART-A1122 2 PART-A2 PART-A21 1 PART-A2 PART-A22 2 PART-A112 4 PART-A1121 1 PART-A2 PART-A22 2 PART-A112 4 PART-A1122 2 PART-A2 PART-A22 2 PART-A221 1 PART-A2 PART-A22 2 PART-A222 3 PART-A2 PART-A221 3 PART-A22 PART-A112 4 PART-A1121 1 PART-A22 PART-A112 4 PART-A1122 2 PART-A22 PART-A221 1 PART-A22 PART-A222 3 PART-B PART-A1 2 PART-A11 2 PART-A111 1 PART-B PART-A1 2 PART-A11 2 PART-A112 2 PART-A1121 1 PART-B PART-A1 2 PART-A11 2 PART-A112 2 PART-A1122 2 PART-B PART-A21 3

<tbody>
</tbody>

1,081,690
Messages
5,360,614
Members
400,592
Latest member

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...