+ Reply to Thread
Results 1 to 4 of 4

VBA Code to Build Org Chart

  1. #1
    Registered User
    Join Date
    02-14-2020
    Location
    Guildford, England
    MS-Off Ver
    Windows 10 Pro
    Posts
    1

    VBA Code to Build Org Chart

    Hi,

    I need help with VBA code so that I can enter a supervisor's ID and name and then run the macro to build a complete hierarchy for that person.

    Per the example below I have a list of supervisors and employees. I want to type in a supervisor's ID and name (ID "1000", Name "Person A") as o the right of the example and then need the macro to run a complete hierarchy for that person. If I did the same for "Person O" I would only see those that name and the 5 reports.

    Appreciate any help!

    Apologies, the table below didn't work out that well... effectively I want to type the name in one cell and below that Excel builds an org chart for that person's reports, and their reports, etc.

    Pieter

    Supervisor ID Supervisor Name Person ID Person Name
    1000​ Person A 1000​ Person A
    1000​ Person A 1001​ Person B 1001​ Person B
    1000​ Person A 1002​ Person C 1004​ Person E
    1000​ Person A 1003​ Person D 1005​ Person F
    1001​ Person B 1004​ Person E 1006​ Person G
    1001​ Person B 1005​ Person F 1002​ Person C
    1001​ Person B 1006​ Person G 1007​ Person H
    1002​ Person C 1007​ Person H 1008​ Person I
    1002​ Person C 1008​ Person I 1009​ Person J
    1002​ Person C 1009​ Person J 1003​ Person D
    1003​ Person D 1010​ Person K 1010​ Person K
    1003​ Person D 1011​ Person L 1013​ Person N
    1003​ Person D 1012​ Person M 1014​ Person O
    1010​ Person K 1013​ Person N 1016​ Person Q
    1010​ Person K 1014​ Person O 1017​ Person R
    1010​ Person K 1015​ Person P 1018​ Person S
    1014​ Person O 1016​ Person Q 1019​ Person T
    1014​ Person O 1017​ Person R 1020​ Person U
    1014​ Person O 1018​ Person S 1015​ Person P
    1014​ Person O 1019​ Person T 1011​ Person L
    Last edited by PJVV; 02-14-2020 at 05:29 AM.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: VBA Code to Build Org Chart

    Just to advise. No one is going to want to re create that layout, and cant be cut and pasted easily so a workbook would go a long way to sorting what you require. See the yellow banner at top of page for how to attach workbook

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: VBA Code to Build Org Chart

    Administrative note
    Please update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to. Members tailor answers based on your Excel version. Your profile does not indicate your version.
    Thanks

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: VBA Code to Build Org Chart

    The treeview approach may suit your requirement.
    A couple of approaches in the link


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can I Build A Chart From RTD Links?
    By Tommyg123 in forum Excel General
    Replies: 0
    Last Post: 09-01-2016, 12:57 PM
  2. Need to build this chart. Possible in Excel?
    By audguy in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-26-2014, 07:51 AM
  3. Build Panel Chart
    By excelhelp18 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-11-2012, 08:52 PM
  4. Build a chart without knowing the exact the end of the table?
    By marlonsaveri in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2011, 02:29 PM
  5. VBA Code to build chart
    By java in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2010, 04:44 PM
  6. problems trying to build this chart..help please!
    By paokun in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 12-03-2006, 05:15 PM
  7. is it possible to build a chart with clustered stacked columns ?
    By Fabio Battagion in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-27-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1