Display all children for a selection in a Hierarchy

dj1ce

New Member
Joined
Apr 3, 2013
Messages
1
Hello Everyone

I have a list of employees and their managers in excel on Sheet1 (A2 through A? is the employee and B2 through B? is their manager). This goes (so far) up to 8 levels deep. I then have a data validation list that sources column A on sheet1 (The list of employees) that is located in cell B2 on sheet2. I want to be able to select a person in cell B2 and have everyone that works for them (directly and indirectly) display in cells C4 through C?. Here is my 'for instance' example below:

John works for Fred. Fred works for Sally. Sally works for Bob. Jim works for Sally.

If I select John, I should see no one
If I select Jim, I should see no one
If I select Fred, I should see John
If I select Sally, I should see Fred, Jim, and John
If I select Bob, I should see Sally, Fred, Jim, and John

Has anyone seen anything like this before? I am not new to VBA, so I can tweak examples if needed, but I can't even think of how to start coding this. Also, I have looked up hierarchy, parent-child, and tree and could not find anything. I did find something in access, but I need this for excel 2007 or 2010. Thanks for your help!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
See the workbook at https://www.box.com/s/lw3lfk71kbc121ac768o

On the Via Code tab, after generating the table, you can autofilter the Reporting Chain column for Contains, and enter an employee number to see their organization.

Not aiming to revive a long dead thread but this document is wonderful. Is it possible to expand this to include multiple top level nodes? I have a data set with more than 4 tree sets together and separating them is challenging.
 
Upvote 0

Forum statistics

Threads
1,214,405
Messages
6,119,315
Members
448,886
Latest member
GBCTeacher

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