+ Reply to Thread
Results 1 to 7 of 7

Thread: Migrating data from columns to rows...

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Unhappy Migrating data from columns to rows...

    Hi! I'm working on a project that involves fixing a DBA's mistakes. This DBA must have been especially dense!

    What I'm looking at is a list of lessons (Lesson ID, Lesson Date, etc.). There is a column in the sheet called Listed Participants. This field has MULTIPLE participant ID's in it. The DBA should have listed each participant with a lesson ID as a single record, rather than clumping them all together.

    I'm at the point now, where I need to separate each Participant ID, insert some rows, and use the lesson ID as the first column and the participant ID as the second column. I'm not sure if I need a lookup. I've already separated the participant ID column into multiple columns (one for each participant ID), using the Text To Columns feature. I have a column that counts the number of participant columns (this number is used to tell the VBA how many rows to insert) I can (through VBA) insert rows in the spreadsheet to accomodate for the new records, but I'm having difficulty telling the system what to copy and where.

    Here's what I HAVE:

    Lesson ID ------------------------------------------------------ Listed Participants
    -----------------------------------------------------------------------------------------------------
    2594 ----------------------------------------------------------> 1525, 1425, 4487, 6698
    4796 ----------------------------------------------------------> 3468, 1711, 5689

    Here's what I NEED

    Lesson ID -----------------------------------------------------Participant ID
    ----------------------------------------------------------------------------------------
    2594 --------------------------------------------------------->1525
    2594---------------------------------------------------------->1425
    2594---------------------------------------------------------->4487
    2594---------------------------------------------------------->6698
    4796---------------------------------------------------------->3468
    4796---------------------------------------------------------->1711
    4796---------------------------------------------------------->5689


    Now, you ask why I don't just do this manually. I have 4455!!!!!! lessons with multiple participants and need to speed this up.

    Any recommendations? Thanks so much! I don't expect code answers (I think I can handle the code), but maybe some insight into how to approach this in a way that doesn't involve throwing the DBA in a lake. Thanks again!

    KellyJo
    Last edited by KatBloom; 08-03-2011 at 03:45 PM. Reason: Formatting bad

  2. #2
    Forum Guru
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2003, 2007.
    Posts
    1,462

    Re: Migrating data from columns to rows...

    KatBloom,

    Welcome to the Excel Forum.

    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan
    stanleydgromjr
    Windows Vista Business, Excel 2003 and 2007

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    08-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question Re: Migrating data from columns to rows...

    Thanks for the welcome! I'm unclear about what in my post was unclear. I posted the sample data, and am looking for insight, not direct code. Any ideas would be greatly appreciated. Thanks!

    KellyJo

  4. #4
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    351

    Re: Migrating data from columns to rows...

    Hi KatBloom. If you're familiar with VBA code, you should be able to loop through the array of Participant IDs without much trouble. Does the data in your spreadsheet actually look like what you've posted, including the dashes and greater than signs? Do you need to have the data on the same sheet or could you put it in a new sheet? If it were me, I'd use a new sheet to put the new format and then use either a counting method or the cells(rows.count, [pastecolumn]).end(xlup) method to input to the next empty row.
    -Greg If this is helpful, pls click Star icon in lower left corner

  5. #5
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Migrating data from columns to rows...

    Hello KatBloom,

    With 2 helper columns. See the attached.
    Attached Files Attached Files
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  6. #6
    Registered User
    Join Date
    08-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Migrating data from columns to rows...

    Haseeb, are you kidding me?! You ROCK! How simple your solution is. I never would have thought of it. Thanks so much! I really appreciate it!

    KellyJo

  7. #7
    Forum Guru
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2003, 2007.
    Posts
    1,462

    Re: Migrating data from columns to rows...

    KatBloom,

    I posted the sample data
    By what you posted we can not tell what worksheet/columns/rows the data is in.

    A macro solution would be very easy to create. The Listed Participants cells can be Split, and new rows inserted, to accomodate your request.
    Last edited by stanleydgromjr; 08-04-2011 at 12:11 AM.
    Have a great day,
    Stan
    stanleydgromjr
    Windows Vista Business, Excel 2003 and 2007

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0