+ Reply to Thread
Results 1 to 4 of 4

Transpose columns into multiple rows

  1. #1
    Registered User
    Join Date
    08-13-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Transpose columns into multiple rows

    Hi Everyone,

    I'm having some difficulty getting a macro to transpose the data I have into multiple columns. Basically I want to keep the ID field as the first column and then take each column's data (including the header as a new column) and transpose into rows.

    I've created an ouput sheet in the attached example to show you exactly what I mean.

    PS - there could be more columns in the final version so I would need it to loop until all columns are transposed

    Can anyone help with the macro to get me from the input to the output ?

    Many thanks in advance.

    Transpose columns to rows - help.xlsm

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Transpose columns into multiple rows

    taylorj3,

    Welcome to the Excel Forum.

    Thanks for the workbook.

    With your raw data in worksheet Sheet1, the results will be in worksheet Sheet2.

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code
    2. Open your NEW workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the ReorgData macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    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-13-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Transpose columns into multiple rows

    That's a beautiful Macro that works perfectly - thank you very much for your help and for welcoming me

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Transpose columns into multiple rows

    taylorj3,

    Thanks for the feedback.

    You are very welcome. Glad I could help.

    And, come back anytime.

+ 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: 4
    Last Post: 03-08-2013, 09:49 AM
  2. [SOLVED] How to transpose one column into multiple rows and columns?
    By Raoul Gonzo in forum Excel General
    Replies: 4
    Last Post: 01-15-2013, 11:00 AM
  3. [SOLVED] How to transpose non-uniform data in multiple columns into multiple rows?
    By alexxgalaxy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-03-2013, 08:40 PM
  4. transpose multiple rows into two columns
    By thane in forum Excel General
    Replies: 2
    Last Post: 09-14-2010, 12:48 AM
  5. transpose multiple rows and columns
    By prawer in forum Excel General
    Replies: 2
    Last Post: 06-03-2009, 04:20 PM

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