+ Reply to Thread
Results 1 to 12 of 12

Recursive find of managers

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Recursive find of managers

    I have two columns of data, Manager and Employee.
    For every Manager, the corresponding column value has their employee.
    there are duplicate entries of manager so every employee is covered.
    Some employees are aslo managers so appear in bolth columns.
    I want to find all the managers that fall under only one of the managers.
    Finding the first level of employees under that manager is simple, but some of those employees are also managers.
    And under those are more managers.

    Suggestions?
    Thanks.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Recursive find of managers

    Hello flyboy54,

    To better understand your problem, it would help if you attach your workbook for review. Please include some before and after examples of what you the macro to do.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Recursive find of managers

    How do I updalod a file?, never don that before.

  4. #4
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Recursive find of managers

    I have attache a sample file.
    In column A is shte list of managers
    In column B is a list of employess, some of whom are also managers.
    In column D is the result I am looking for, the list of managers under Alice.
    Thanks.
    Attached Files Attached Files

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Recursive find of managers

    Hello flyboy54,

    Do want a unique list of the managers in column "D"?

  6. #6
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Recursive find of managers

    The inputs are columns A and B.
    I want to be albe to work down those lists and find the managers and submanagers who are under Alice.
    So the results I would is expect are in column D.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Recursive find of managers

    Hello flyboy54,

    This is how I see the table of managers and employees who are also managers
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Recursive find of managers

    If you look at the data in columns A and B, Alice has an employee who is Fred.
    Fred is a manager.
    He has an employee Barb
    Barb is a manager.
    Barb has an employee Martha
    Martha is a manager.

    So I want to programatically create the list I show in column D that contains Alice, Fred, Barb and Martha.
    This is a sample file, but the actual list I am working with is 720 lines long.
    So I am looking for suggestions on how tp programatically process the list of Managers and Employees and derive the list of managers under a given manager.
    Thanks.

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Recursive find of managers

    Hello flyboy54,

    I didn't forget about you. The attached workbook has the macros shown below added to it. I have added a button on Sheet1 to run the macro. The managers names are listed in row 1 starting in column "D" and go to the right. The employees who are also managers are listed below each manager as in your original post. Let me know if this what you wanted.

    Recursive Search Code for Managers
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Recursive find of managers

    Leith,
    This is exactly what I was looking for, thanks.
    I will mark it as solved.

  11. #11
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Recursive find of managers

    Leith,
    As a follow up, I ran this against the actual data of 720 lines and it worked.
    Thank you again.

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Recursive find of managers

    Hello flyboy54,

    You're welcome. It was a challenging and fun project. Really good to hear it worked on the actual data with no problem.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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