+ Reply to Thread
Results 1 to 5 of 5

How to move data within a row and keep the data from the first column

  1. #1
    Registered User
    Join Date
    05-09-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    15

    How to move data within a row and keep the data from the first column

    Hello!!
    I currently have a columns and rows of data, the first column A has the main data title, the following columns have unique data that goes along with column A. What I want to do is have the data in column A pull information from the rows and place it under a new row with the first data in column A. I'll try my best to post an example below...

    _____________________________________________________________________
    l______A___l______B_____l_____C____l____D___l___E____l___F_____l_____G___l
    l__FRUIT___l___orange____l___ pear___lpineapplel__apple__l___pie___l__Grape___l

    what I would like to see is this

    __________________________________________
    ______A___l______B_____l_____C____l____D___l
    l__FRUIT___l___orange___l
    l__FRUIT___l___pear_____l
    l__FRUIT___l_pineapple___l
    l__FRUIT___l___pie______l
    l__FRUIT___l___Grape____l

    Any help would be appreciated!! Thanks

  2. #2
    Registered User
    Join Date
    05-09-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: How to move data within a row and keep the data from the first column

    Here's a clearer example

    From this
    Fruit orange Pear Pineapple Grape Apple Pie


    To this

    Fruit orange
    Fruit Pear
    Fruit Pineapple
    Fruit Grape
    Fruit Apple
    Fruit Pie

    Also, I should mention that there are about 500 rows that look like this in one sheet.
    Last edited by chadman; 05-15-2013 at 09:16 AM.

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

    Re: How to move data within a row and keep the data from the first column

    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]

  4. #4
    Registered User
    Join Date
    05-09-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: How to move data within a row and keep the data from the first column

    Thanks for the reply!! For some reason the macro added a 1 on certain lines. However, I figured it out by sorting and making multiple sheets, then just combining them into one.

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

    Re: How to move data within a row and keep the data from the first column

    You do not need to sort into sheets and then combine. I ran the macro on the sample you gave and it worked fine.

    Maybe if you upload a sample which is more symbolic of your data, then it will be better and i can help you.

+ 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