+ Reply to Thread
Results 1 to 8 of 8

Move data in a column to a row

  1. #1
    Registered User
    Join Date
    02-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Move data in a column to a row

    Hello,

    I have a set of data in Column A which looks like this:

    1
    2
    3
    4
    5
    6
    1
    2
    3
    4
    5
    6
    7
    .
    .
    .

    I would like to know if there is a macro where it will poplulate my data in rows and get this result:
    1 2 3 4 5 6
    1 2 3 4 5 6 7

    I need the macro to run through the entire column A.

    I have attached a sample spreadsheet.

    Thanks,
    Attached Files Attached Files
    Last edited by mukori; 08-14-2012 at 12:13 PM.

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Move data in a column to a row

    In your data, what will trigger the code to move down to the next row? In this example, when the number 1 repeats, it signals a new row. What if two 1's appear immediately after each other? Are there any nuances to consider?

  3. #3
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Move data in a column to a row

    is there a qualifer of when the macro would go to the next row? a sample book with data and results could help.

    if you want it all in one row, you could simply transpose the data using paste special, and checking the transpose box.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  4. #4
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Move data in a column to a row

    Try this:

    Please Login or Register  to view this content.
    I hope that helps.
    Last edited by Pichingualas; 08-14-2012 at 11:54 AM.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  5. #5
    Registered User
    Join Date
    02-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Move data in a column to a row

    Hello,

    Sorry this set of data is nasty. But the start of the column should always says "Start of Log...." and anything else after that will be need to be populated into the columns B, C, D, E and on.

    I attached a sample of the actual data.... this may help.

    Thanks for all your help.
    Attached Files Attached Files
    Last edited by mukori; 08-14-2012 at 12:14 PM.

  6. #6
    Registered User
    Join Date
    02-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Move data in a column to a row

    Hello Pichingualas.

    Thanks for your help! Yes it does work, but only half way. I need the macro separate the data so if it starts with 1 it will place it in the next row and then repeat the copying from the column to the row like the numbered example I provided above. Is that possible?

    Thanks,

  7. #7
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Move data in a column to a row

    Hi Mukori,

    Take a look at the code posted herein and see if it can work with your dataset. Instead of modifying the data in the same worksheet, it copies it over to a new worksheet. To do so, I made a couple of assumptions. I assumed the data is in a sheet named Sheet1. I also assumed there was a sheet named Sheet2 into which I can copy the data. If this is not the case, then make adjustments to the code or the workbook. Finally, I made an assumption that ALL of the data in Sheet1 is being analyzed, and the first row always starts with the "Start of Log" data. If these aren't true (this matches the format in your sample workbook), please let me know and we can adjust.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Move data in a column to a row

    Awesome! It worked like a charm! Thanks.

+ 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