+ Reply to Thread
Results 1 to 6 of 6

Split Single Row into multiple rows based on column data

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    71

    Split Single Row into multiple rows based on column data

    I need to modify raw data that is pulled from online submissions. The data is for tournament entries that can have a single person up to a team of 3 that exports all to one line. Entries with 2 or 3 participants need to be cut and inserted into rows below the active row. I found code that works properly for data in Col U-AF but pastes data from Col AG-AR wrong (code pasted below).
    • The number of rows for the original raw data will vary.
    • Each row will always have data in Col A-T.
    • The length of each row will contain data for 1 to 3 people.
    • Participants 2 & 3 need to be pasted on new rows starting at col F.
    Example:
    1. If column U-AF contains data then:
    (1) Insert ONE row below
    (2) Cut/Paste data from col U-AF into NEW row starting at col F.
    2. If there is no data in col U then move to next column.
    3. If col U-AR contains data then:
    (1) Insert TWO rows below.
    (2) Cut/Paste data from Col U-AF in the FIRST NEW row.
    (3) Cut/Paste data from Col AG-AR in the SECOND NEW row.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Split Single Row into multiple rows based on column data

    See if this works for you.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Split Single Row into multiple rows based on column data

    It worked on every row but the first (row 2). There is still data in columns after T. Is there any way to fix that?

  4. #4
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Split Single Row into multiple rows based on column data

    Here is a snap of what it was doing. Forum - Tourney Snap.jpg

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Split Single Row into multiple rows based on column data

    I was basing the source range on the code in post #1 where it indicates that source data begins in row 3. Is that incorrect? According to the screen shot in post #3 , row 1 and 2 are header rows and data begins in row 3, so the code should be returning any data found in row 3 on an inserted row if it exceeds the 21 cell limit.

  6. #6
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Split Single Row into multiple rows based on column data

    BTW, the rng variable wasn't used, so here is a revised code which excludes that bit.
    Please Login or Register  to view this content.
    I just took a closer look at your screen shot. The code above has been modified to use row 2 as the first source row.
    Last edited by JLGWhiz; 04-29-2017 at 02:01 PM.

+ 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: 1
    Last Post: 04-06-2016, 07:02 AM
  2. Need Macro code to split data split in 7 sheets based on variable rows in column A
    By Alija_21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-31-2015, 08:03 AM
  3. [SOLVED] Multiple values in single cell (known column) split into rows with duplicate information
    By bwashbourne in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2015, 05:00 PM
  4. Split Data From Single Column Set Into Multiple Column Sets?
    By slavrenz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-25-2014, 04:33 AM
  5. split single spreadsheet into multiple workbooks based on value in column D
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2014, 07:27 PM
  6. Replies: 10
    Last Post: 07-22-2012, 07:32 PM
  7. Want to split the data in single cell to multiple column
    By pradeepdeepu_001 in forum Excel General
    Replies: 4
    Last Post: 02-02-2010, 09:11 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