Create parent-child set

vipett

New Member
Joined
May 6, 2021
Messages
17
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have a list as per below, where the A0001 item contains five components, and one of them, B0005, is broken down in to three components.
I would like to see it as a "tree view" where I can see the items needed for A0001 down to the lowest level.
Please note that B0005 can also be used in other products.
Item numberItem nameSub itemSub item nameQuantity
A0001Product AB0001Box
1​
A0001Product AB0002Screw 1
3​
A0001Product AB0003Screw 2
2​
A0001Product AB0004Motor
1​
A0001Product AB0005Filterbox X
1​
B0005Filterbox XC0001Filter
1​
B0005Filterbox XC0002Tape
2​
B0005Filterbox XC0002Locking screw
4​


This is the kind of output I would like to get:
Item numberItem nameSub itemSub item nameItem number Lvl 2Item name Lvl 2Sub item number Lvl 2Sub item name Lvl 2Quantity
A0001Product AB0001Box
1​
A0001Product AB0002Screw 1
3​
A0001Product AB0003Screw 2
2​
A0001Product AB0004Motor
1​
A0001Product AB0005Filterbox XB0005Filterbox XC0001Filter
1​
A0001Product AB0005Filterbox XB0005Filterbox XC0002Tape
2​
A0001Product AB0005Filterbox XB0005Filterbox XC0002Locking screw
4​

I did once manage to do it in PowerBI and then exported it back to Excel, but I can't remember how I did it and can't recreate it.

Any suggestions on how to do this with VBA?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,216,095
Messages
6,128,790
Members
449,468
Latest member
AGreen17

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