+ Reply to Thread
Results 1 to 5 of 5

Insert Rows and Transpose

  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    2

    Insert Rows and Transpose

    Hi,

    I'm trying to create a macro that will insert rows based on the number of items in a row, and then transpose that information into the new rows.

    Essentially I'm trying to take my horizontally stores data and make it vertical.

    I've attached an example excel sheet to show what I'm trying to do.

    Thanks for any help.
    Attached Files Attached Files

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

    Re: Insert Rows and Transpose

    Niviac,

    Welcome to the Excel Forum.


    Detach/open workbook ReorgData w1 wR LR LC - Niviac - EF771548 - SDG10.xlsm and run macro ReorgData.


    The macro assumes that your raw data is in worksheet Sheet1. It creates a new worksheet Results with the data re-organized per your request.




    To test the macro in another workbook:



    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, by highlighting the code and pressing the keys CTRL + C
    2. Open your 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 by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and 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.

    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
    04-07-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Insert Rows and Transpose

    Works great! Thanks!

    Quote Originally Posted by stanleydgromjr View Post
    Niviac,

    Welcome to the Excel Forum.


    Detach/open workbook ReorgData w1 wR LR LC - Niviac - EF771548 - SDG10.xlsm and run macro ReorgData.


    The macro assumes that your raw data is in worksheet Sheet1. It creates a new worksheet Results with the data re-organized per your request.




    To test the macro in another workbook:



    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, by highlighting the code and pressing the keys CTRL + C
    2. Open your 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 by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and 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.

    Then run the ReorgData macro.

  4. #4
    Registered User
    Join Date
    02-13-2009
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Insert Rows and Transpose

    Thanks, landed here from Google search and found exactly what I was looking for!
    Thanks a lot!

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

    Re: Insert Rows and Transpose

    sunny155,

    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)

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