+ Reply to Thread
Results 1 to 7 of 7

Taking data in rows and stacking into columns

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    1

    Taking data in rows and stacking into columns

    Hi,

    I'm a new member to the forum and hoping someone may be able to help me out with this question.

    I have a workbook that compiles data by Employee ID in a row format, meaning that all data for that employee is in one, single row. However, to upload this data into another system I have to stack some data into multiple rows, then move the next employee and so on.

    To get a better understanding, please take a look at the attached file. I have one tab that shows how the data is originally compiled, then the 2nd tab shows how the import file should look. I would like to have excel take the 1 row of original data and stack it into the 3 rows needed for the import.

    Please post any questions and I'll answer as soon as possible. Thanks to everyone in the group for your assistance.
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Taking data in rows and stacking into columns

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    03-04-2013
    Location
    Newcastle
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Taking data in rows and stacking into columns

    Go with Arlu's code so much simpler haha

    Hopefully this should work.

    Providing that you do not input any more data horizontally :P

    Please Login or Register  to view this content.
    Last edited by Eliat; 03-20-2013 at 11:58 AM.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Taking data in rows and stacking into columns

    Eliat,

    When i just started with VBA, i also used to code using the Select and Activate statements. You can do away with it. Just go through my code and see how it works.

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Taking data in rows and stacking into columns

    Arlu,

    Thanks for the code, however I cannot get it to work. When I run the Macro Excel locks up and I have force close the program to continue. Any ideas?

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Taking data in rows and stacking into columns

    Did you get any popup to enable macros?

  7. #7
    Registered User
    Join Date
    03-04-2013
    Location
    Newcastle
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Taking data in rows and stacking into columns

    Jcoe,

    I would suggest going into the VBA editor and by using F8 going through the process step by step to find the part of the code that breaks your computer.

    Hi Arlu,

    For some reason
    Please Login or Register  to view this content.
    Doesn't work for me.

    This addition would seem to fix that problem on Excel 2010:

    Please Login or Register  to view this content.

+ 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