VBA to Create New Tables Based on Data

horrellbt01

Board Regular
Joined
Mar 15, 2010
Messages
65
I have a table of data that I would like to split up into multiple tables based on Parent/Child Relationships.

ParentChildItemOrder
Joe SmithJaden Smith
12345​
5​
Joe SmithJaden Smith
54321​
2​
Joe SmithEmma Smith
54321​
1​
Jane EmmitHank Emmit
12345​
5​

Above is a sample table, actual has thousands of rows with many parent/child combinations.

I am looking for a Macro solution to create a new worksheet for each unique Parent with separate tables for that Parent/Child relationship within that worksheet.
So after running I would end up with the following:

New Worksheet "Joe Smith"
New Worksheet "Jane Emmit"

Within Worksheet "Joe Smith"
Table "Jaden Smith"
Table "Emma Smith"
Each table containing all rows for that parent/child combination

Within Worksheet "Jane Emmit"
Table "Hank Emmit"
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Is the source data actually in a table and if so what is it called and what is the name of the worksheet that it is on?

In the tables created are they to contain all four columns from the source data?
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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