+ Reply to Thread
Results 1 to 5 of 5

Breaking hierarchical list into separate columns

  1. #1
    Registered User
    Join Date
    03-29-2017
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    60

    Breaking hierarchical list into separate columns

    I have a sheet that has a hierarchical BOM list in column A. For each branch, there is added space before the text of the BOM item. I need a macro, that will break the list into separate columns for each branch. This is all found in column A. The branches can go out to go out to a possible "O" branches (referring to my example below), or 15 branches. The only branch without space wil be the main item A. Not all branches will be the same, but the amount of spaces, for example before "B" will be the same, and for "C" will be the same....

    HTML Code: 

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Breaking hierarchical list into separate columns

    You mean you simply want to move indented text to col X (depending on the number of spaces), nothing else?

  3. #3
    Registered User
    Join Date
    03-29-2017
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    60

    Re: Breaking hierarchical list into separate columns

    Yes. Except that indented text such as the indent for B must all be in column B..etc...

  4. #4
    Registered User
    Join Date
    03-29-2017
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    60

    Re: Breaking hierarchical list into separate columns

    Do I get rep points for solving this myself? Here is the code in case anyone is interested. It can be adjust to your own needs with minor coding experience.

    HTML Code: 
    Last edited by billyjo182; 06-09-2017 at 08:42 PM.

  5. #5
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Breaking hierarchical list into separate columns

    You get Rep points for using a forum as it should be used - having a go rather than sitting back and just waiting for someone to do it for you - so for that.

    However, it can be shortened.

    Use the information you have - a cell starts with a space so it needs to be moved to another column - the number of columns to move it is simply the number of spaces at the start. So a simple calculation will give you that.

    Alternative code
    Please Login or Register  to view this content.
    It's a little longer than it needs to be as each step is broken down for clarity.

    Minimalist version
    Please Login or Register  to view this content.
    Last edited by cytop; 06-10-2017 at 04:04 AM.

+ 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. Replies: 2
    Last Post: 11-24-2016, 02:35 PM
  2. [SOLVED] Hierarchical Dependent Drop Down List???
    By qanjorin in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 01-18-2016, 03:16 AM
  3. Dependent Hierarchical Drop Down List with more than 7 Nested IF Statements
    By qanjorin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-17-2016, 08:16 AM
  4. Replies: 2
    Last Post: 07-06-2012, 05:31 AM
  5. Excel 2007 : Breaking Down Numbers into Separate Columns
    By tbblizzard in forum Excel General
    Replies: 3
    Last Post: 11-01-2010, 11:25 AM
  6. Hierarchical List
    By Paul in forum Excel General
    Replies: 1
    Last Post: 08-02-2006, 09:05 AM
  7. Breaking up a string into separate columns
    By Loz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-21-2005, 11:15 PM

Tags for this Thread

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