+ Reply to Thread
Results 1 to 9 of 9

Macro to combine data from multiple rows

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Macro to combine data from multiple rows

    Hi

    I am new to the forums, but I have always been able to find what I need here, so I thought maybe someone could help me

    I am trying to write a macro to combine data from multiple rows into one line of data. The worksheet is over 8000 rows long.

    The raw data is pulled from 7 different worksheets, and I have been able to combine it down to two, three or four rows for each name - but the data I need could be on two or three of those rows, and not always the same ones. I have attached a small sample spreadsheet to show what it looks like at present, and what I need it to look like.

    If there is a quicker way (ie non macro), I am also open to hearing about that.

    Thanx guys

    Tracy
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Macro to combine data from multiple rows

    hi Tracy, welcome to the forum. maybe something like this?

    Please Login or Register  to view this content.
    should be able to shorten it further though

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    11-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro to combine data from multiple rows

    Beni

    You are my hero, not only does it do exactly what I need, but your quick response means I can finish this project tonight.

    Thank you, thank you, thank you

  4. #4
    Registered User
    Join Date
    11-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro to combine data from multiple rows

    ...Just found ONE record that didn't merge properly, example attached, any way to fix that one?? The two "Smith, Ryan" with no initials come to me that way from payroll, so the only distinguishing criteria is the "payroll no."
    Attached Files Attached Files
    Last edited by mummafrog; 12-03-2012 at 05:01 AM. Reason: attachment

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to combine data from multiple rows

    Not sure if this what you want

    Please Login or Register  to view this content.
    Last edited by AB33; 12-03-2012 at 07:07 AM.

  6. #6
    Registered User
    Join Date
    11-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro to combine data from multiple rows

    AB33 - That does do what I want, but only on my test worksheet

    When I run it on my 8000 row spreadsheet with full data, it doesn't do anything at all to the data.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to combine data from multiple rows

    I have amended code (#5). Please see if this works

  8. #8
    Registered User
    Join Date
    11-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Macro to combine data from multiple rows

    AB33 - nothing has changed???

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Macro to combine data from multiple rows

    Try this
    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