+ Reply to Thread
Results 1 to 12 of 12

Macros to move multiple rows to one row.

  1. #1
    Registered User
    Join Date
    05-19-2009
    Location
    Regina, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Macros to move multiple rows to one row.

    This report spreadsheet is exported from SAP. Since SAP has a limit number of displaying the columns, there are 40 headings (= 40 columns) in the report has been broken down to 4 rows of headings. How to use macros to move 3 those extra rows to one row and the number still matches each column? I also attatch the file for reference. Very appriciate 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: Macros to move multiple rows to one row.

    trangie,

    Please post another workbook with sheet "file", and a second sheet with the manual results you are looking for (for about 20 rows).
    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
    05-19-2009
    Location
    Regina, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macros to move multiple rows to one row.

    Hi Stan, this is the file as you said
    Attached Files Attached Files

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

    Re: Macros to move multiple rows to one row.

    trangie,

    See the attached workbook "Move multiple rows to one row - trangie - SDG.xlsm" with macro "MoveRows".

    Then run the "MoveRows" macro.

  5. #5
    Registered User
    Join Date
    05-19-2009
    Location
    Regina, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macros to move multiple rows to one row.

    Hi Stan, thanks for your solution. Just a problem that when I run that macro for the complete worksheet, the heading is overslapped. The heading is the line started with Telco Telco VP ............
    Last edited by trangie; 05-21-2009 at 11:45 AM.

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

    Re: Macros to move multiple rows to one row.

    trangie,

    Post another workbook with the true layout of your worksheets.

  7. #7
    Registered User
    Join Date
    05-19-2009
    Location
    Regina, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macros to move multiple rows to one row.

    here is the true layout. On Sheet2, i only manually adjust first few lines because there are more than 2000 lines in this report.
    Attached Files Attached Files

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

    Re: Macros to move multiple rows to one row.

    trangie,

    See the attached workbook "Move multiple rows to one row - trangie - V2 - VP - SDG.xlsm" with the new updated "MoveRows" macro.

    Then run the "MoveRows" macro.

  9. #9
    Registered User
    Join Date
    05-19-2009
    Location
    Regina, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macros to move multiple rows to one row.

    This one works perfect! thank you Stan

    By the way, just want to consult you one more thing. This is the macro doing the same way that I and my co-worker created before, but it works slower because the code is adjusting manually column by column depending on range A1 ( Telco column ) then looping. So now for example we don't want the column 'Telco' anymore, how can we edit this macro ?
    Attached Files Attached Files
    Last edited by trangie; 05-22-2009 at 01:05 PM.

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

    Re: Macros to move multiple rows to one row.

    trangie,

    I am glad that my macro is working correctly for you.

    I have looked at your co-workers code, and I will not be able to adjust it because I can not follow their logic.

  11. #11
    Registered User
    Join Date
    04-16-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macros to move multiple rows to one row.

    I need help with a file if you can be so kind. My friend sent me this from an AOL account and it looks as if the formatting is gone. I am using MS Office 2010. I would like to have the data from each product in one row.

    I sent the original file and changed the first 2 lines to show what he wants it to look like.

    Any help will be appreciated

    Mike
    Attached Files Attached Files

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

    Re: Macros to move multiple rows to one row.

    Mikeyd1,

    In the future you should start your own new Post.


    Thanks for the workook.

    Please post another workbook with worksheet utf8BQ2j containing just the raw data in column A, just the way you receive it, and beginning in column C, row 1, the resulting format for three of the groups from column A.

+ 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