+ Reply to Thread
Results 1 to 5 of 5

Conditional copy/merge rows with some duplicate, some unique lead cell value

  1. #1
    Registered User
    Join Date
    03-27-2012
    Location
    Bloomington, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Conditional copy/merge rows with some duplicate, some unique lead cell value

    This is fabulous. I'm wondering if there is a way to tweak it to work for me. What I need to do is merge information where any rows which have matching entries in cells columns A thru F will have all other cells in their rows G through infinity merge, but not add/sum any numerical information. In practice, doing this should only replace blank cells with text and/or numbers, but on the off chance that there are two numerical values that need to merge, I would want them both to show. Similarly on the off chance that there were two sets of text, I would want them both to appear in a single cell.

    What I'm trying to do is take an updated list of students who have applied to a program which will include students from older lists, but also new students who have applied since the last list was run & merge it with the old list which also contains columns of text and numerical values which have been manually entered. I want to get rid of new blank rows where the entries in columns A-F match 100%, retain the manually entered notes, and not delete or copy information into rows of students who are appearing on the list for the first time (and thus have not had any notes manually entered). So the "copy from line below" formula will not work because in some cases that might copy notes from one student into another since some students will only have a single row whereas others will be repeat. I hope that makes sense. I need to do this weekly, so not having to manually/eyeball deleting duplicate rows & copying/pasting unique note cells would be a godsend.

    Any advice would be greatly appreciated!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional copy/merge rows with some duplicate, some unique lead cell value

    Post a sample workbook showing a small amount of sample data in the exact layout as the real set (BEFORE), then show another sheet demonstrating your desired results (AFTER). Make sure the sample data represents all these little variations.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-27-2012
    Location
    Bloomington, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Conditional copy/merge rows with some duplicate, some unique lead cell value

    I'm not sure how to do that without divulging protected personal information or spending a lot of time making up fake names because the names are the primary factor determining whether or not a line is unique.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional copy/merge rows with some duplicate, some unique lead cell value

    That's why I said "small sample". You spend time creating a usable, shareable sample, we spend time trying to help figure out your solution. Certainly it is not cumbersome to manually edit 10-15 names. But even if it were, we'll still need it, so it is what it is.

  5. #5
    Registered User
    Join Date
    03-27-2012
    Location
    Bloomington, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Conditional copy/merge rows with some duplicate, some unique lead cell value

    Sorry - I must have breezed past the "small" sample part. Thanks for bearing with me.

    I've attached a before sample plus an after sample. I should specify that the after doesn't show the desired end result, but it shows the point at which I would like to apply a macro. I have pasted in the updated data from the database & then sorted by name. As you can see, some names have 2 lines in the before and 3 or 4 in the after. Some names don't appear at all in the before, but do in the after. Some of the before names do not appear in the new data & therefore only have their "before" line in the after.

    What I want a macro to do is to look in each row for matching cells in columns A, B, & D, and where all 3 of those cells match, take the entries in E through infinity & paste them up into the empty (or in some cases replacing the content of cells C & E) cells of the matching row. Then delete the original row. Where rows have no matching A, B, & D cells in any other row, I want them left alone & not deleted. These rows may or may not occur consecutively as the "after" attachment shows.

    Is this possible?
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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