+ Reply to Thread
Results 1 to 7 of 7

Moving Rows and Columns with a Macro

  1. #1
    Registered User
    Join Date
    06-05-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Moving Rows and Columns with a Macro

    I have a massive data file with thousands of lines of data. Each line is a pair, for example
    Please Login or Register  to view this content.
    I want to take the Description that is located on two lines within the same row and change it so the new columns would be:
    Please Login or Register  to view this content.
    It is possible to create a macro that would do this for every pair?
    Last edited by Leith Ross; 06-05-2009 at 01:23 PM. Reason: Restructured Data Tables

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Moving Rows and Columns with a Macro

    Hello mtcnd2002,

    Welcome to the Forum!

    Would it be Okay to transfer the information over to a new sheet? This would be faster and not disturb the original data.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-05-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Moving Rows and Columns with a Macro

    Hello,

    Moving the information to a new sheet would not be a problem.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Moving Rows and Columns with a Macro

    Hello mtcnd2002,

    This macro will restructure the original data on another worksheet. In this case the worksheets are "Sheet1" (Source) and "Sheet2" (Destination). Both sheets' data start at cell "A2"
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-05-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Adjusting the Macro: Re: Moving Rows and Columns with a Macro

    Quote Originally Posted by Leith Ross View Post
    Hello mtcnd2002,

    This macro will restructure the original data on another worksheet. In this case the worksheets are "Sheet1" (Source) and "Sheet2" (Destination). Both sheets' data start at cell "A2"
    Please Login or Register  to view this content.
    This macro worked well for me but I am having trouble adjusting it for some new data problems. The data is in four rows and one column. The data is listed like this:

    A
    B
    C
    D
    E
    F
    G
    H

    Etc.

    I want to convert so it is listed like this:
    A B C D
    E F G H

    Is there a way to adjust this macro to do that?

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Moving Rows and Columns with a Macro

    Hello mtcnd2002,

    Here is another macro to convert your data. This takes the data in a single column divides into groups of 4 rows and copies these rows to another sheet.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-05-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Moving Rows and Columns with a Macro

    Thank you this worked well to fix the problem.

    I can't seem to mark this as solved... it doesn't give me an edit button on the first post.
    Last edited by mtcnd2002; 10-27-2009 at 04:36 PM.

+ 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