+ Reply to Thread
Results 1 to 8 of 8

Split column into multiple columns at predetermined rows

  1. #1
    Registered User
    Join Date
    09-30-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Split column into multiple columns at predetermined rows

    Hello everyone. I hope someone can help. I have two distinct questions that follow from each other. If you can only answer one of them, I would still really appreciate it.

    1) Column A has 300,000+ rows of data. The data is from a repeating set of data but the sets are of unequal length. Column B lists the row numbers at which each set ends. Is there any way I can split column A into multiple columns on a new sheet based on the values in column B?

    For example.
    Column B has the following (the commas represent the next cell down) : 30, 167, 306, 534, 867, 1442, etc. etc.
    Is there anyway that I can automatically split column A into a new sheet with column A being rows 1-30, Column B being rows 31-167, Column C being rows 168-306, Column D being rows 307-534, etc?

    2) Once I have my new sheet of multiple columns, is there anyway to take each column, and split it into equal columns of x rows each, one on top of the other in a new sheet? Using the above example and a value of 100 for x, Column A of Sheet 2 (rows 1-30) would fill cells A1:A100 (with blanks in rows 31-100) in Sheet 3, then Column B (rows 31-167) would fill cells A101:A200 and B101:B137 in Sheet 3 (because Column B has 137 cells), then Column C would fill cells A201:A300 and B201:240, then Column D would fill A301:A400 and B301:B400 and C301:C328 (because Column D has 228 cells).

    I really appreciate any help. Thanks so much!

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Split column into multiple columns at predetermined rows

    try this for the first problem
    Please Login or Register  to view this content.
    i did not understand the second, a sample file wil be helpful
    Last edited by patel45; 09-30-2012 at 07:24 AM.
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Split column into multiple columns at predetermined rows

    Here is the right post

    Please Login or Register  to view this content.
    If you are pleased with a member's answer then use the Star icon to rate it.

  4. #4
    Registered User
    Join Date
    09-30-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Split column into multiple columns at predetermined rows

    Holy cow, you are both amazing!!! Thank you so much!!! Patel, thank you so much (I don't need help for the second part, as Buran solved it). Buran, that was particularly incredible! I humbly bow before both your macro skills.

  5. #5
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Split column into multiple columns at predetermined rows

    great, glad that it helps. don't forget to mark thread solved

  6. #6
    Registered User
    Join Date
    09-30-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Split column into multiple columns at predetermined rows

    Buran,

    One question: The second sheet (problem 2) seems to be duplicating and adding in an extra cell on the last cell for each split?

    For example, Column A (first generated sheet) ends off with "boy." Column B (first generated sheet) starts with "girl."
    The macro flawlessly splits Column A (from the first sheet) into columns of only 100 rows, and fills cells A1:C100, populating every cell from Column A (from the first sheet).
    Column B (from the first sheet) should then start at A101 with "girl." Instead, however, it fills A101 with "boy" (the last value from Column A from the first sheet) and then starts "girl" (i.e. column B from the first sheet) in A102.

    Any ideas?

  7. #7
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Split column into multiple columns at predetermined rows

    Sorry, my mistake

    Here it is

    Please Login or Register  to view this content.
    The problem was in the split from original to second sheet (first problem).
    Last edited by buran; 09-30-2012 at 09:26 AM. Reason: explanation

  8. #8
    Registered User
    Join Date
    09-30-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Split column into multiple columns at predetermined rows

    Yes, now it is perfect! Again, thank you so much!!!

+ 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