+ Reply to Thread
Results 1 to 7 of 7

Macro to find matching cells, then merge, and add data to show row was merged

  1. #1
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Macro to find matching cells, then merge, and add data to show row was merged

    Good morning.

    I have a list of customer details, including name, address, service pricing, year service performed etc...

    I'm looking for a VBA that will find the duplicate addresses (it will need to look at D and E). If they both match then it will merge to the one with the newest year. All data merged will be the newest info and the last column will note the merged years... 2011 and 2012 will turn into 11,12 for example

    See attached to make more sense.. The Sample tab is how the list of data will look, the Result tab is how the result of the VBA would look. The actual lists are quite large.

    It is also possible that some street names are not written identically. Forth St. and Forth Street for example.. Not sure of the VBA could figure out if this is the same... The duplicates should always be sorted so that they are next to each other, if that helps...

    Thanks for your time.

    merge_dates_sample.xlsx

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

    Re: Macro to find matching cells, then merge, and add data to show row was merged

    Forth St. and Forth Street are not identical in VBA. Can only be identical if they are the same, but with different lower and upper cases.
    Which one is new then 12th May or 25th April?

  3. #3
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Macro to find matching cells, then merge, and add data to show row was merged

    If possible, I'd like to use the Year as he 'new' ?

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

    Re: Macro to find matching cells, then merge, and add data to show row was merged

    Try the attached.
    I have got a different result in column N.
    I will log off very shortly and will check my message at some point tomorrow.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Macro to find matching cells, then merge, and add data to show row was merged

    Thanks AB.. I'm using Office for Mac. I believe the scripting is not compatible.

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

    Re: Macro to find matching cells, then merge, and add data to show row was merged

    Oops,
    Sorry!
    I did not see your profile.
    I think there is a version of script which is compatible with Mac, but unfortunately, I have never used it. Hope fully, others will butt in to help you.

  7. #7
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Macro to find matching cells, then merge, and add data to show row was merged

    Thanks AB..

    If anybody could be of assistance with a solution that would be Mac compatible, it would be greatly appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 06-28-2012, 11:53 AM
  2. [SOLVED] Merge Cells When Other Merged Cells Receive Specific Data
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 39
    Last Post: 04-03-2012, 10:34 AM
  3. Replies: 4
    Last Post: 10-06-2011, 12:57 PM
  4. Replies: 0
    Last Post: 09-01-2011, 10:19 AM
  5. Import/merge data by matching cells
    By jordanw1321 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-22-2010, 04:39 PM

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