+ Reply to Thread
Results 1 to 9 of 9

merge duplicate lines while appending unique data

  1. #1
    Registered User
    Join Date
    06-17-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    52

    merge duplicate lines while appending unique data

    Hello all,
    I have an excel grid with thousands of rows and 21 columns of data. Most of the rows have duplicate data, and I want to remove the dupes. The problem I have is:
    1. the last 6 columns have unique data, and
    2. I need to keep that data.

    Is there a way to merge the lines and append unique data after the 21 base columns?

    I have attached an excel grid which details what I am trying to do. There are 2 tabs describing what I have now (Before) and what I am trying to achieve (After). I am using Excel 2007.

    Any assistance would be greatly appreciated. Thanks!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: merge duplicate lines while appending unique data

    Hi,

    please don't do that, you would destroy your spreadsheet.

    Reasons for keeping the data this way:
    - you can make pivot tables
    - you can make graphs
    - you can filter for each column of data
    - you can see almost all the data for one patient on one screen

    My advice is to just apply a filter and freeze the top row. See attached file.
    Attached Files Attached Files
    Last edited by RHCPgergo; 01-16-2013 at 04:31 PM. Reason: typo

  3. #3
    Registered User
    Join Date
    06-17-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: merge duplicate lines while appending unique data

    Thank you very much for the reply. I am actually preparing my data to be imported into a very fussy software program. The program requires that all claim lines be on 1 line; not multiple lines.

    I will of course be saving a copy of my original data before proceeding.

  4. #4
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: merge duplicate lines while appending unique data

    Oh, okay.

    In that case, let me figure it out.

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

    Re: merge duplicate lines while appending unique data

    My out put is not exactly the same as yours, but this is probably due to the way you copied them manually. The code overwrites the existing data, so there is not separate sheet out put. Try it any way.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: merge duplicate lines while appending unique data

    Okay, here it is. Just run the macro while active sheet is the sheet that you want to reorganize.

    The procedure doesn't reenter column headers to the first row, I hope that's not a problem.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-17-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: merge duplicate lines while appending unique data

    Thank you very much to both of you! I don't have access to the real data until tomorrow morning, but I tried both of your macros with the sample data. They both great!

  8. #8
    Registered User
    Join Date
    06-17-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: merge duplicate lines while appending unique data

    Thank you very much! The macro worked perfectly.

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

    Re: merge duplicate lines while appending unique data

    Tiger,
    You are welcome!
    Could you please now close this thread as solved. Go in to the top right -hand side of this page, select "Thread Tools", pick up Solved from the drop down menu.

+ 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