+ Reply to Thread
Results 1 to 7 of 7

Removing Duplicates in ColA Keep Unique Data in Column AC

  1. #1
    Registered User
    Join Date
    02-18-2016
    Location
    murica
    MS-Off Ver
    2010
    Posts
    4

    Removing Duplicates in ColA Keep Unique Data in Column AC

    Hey Everyone,

    I have a table that is used for work. Every so often a .csv data set is copied from a workbook that was exported out of a CRM and gets pasted below the table within the workbook in question. Then duplicates are then combined. However I wanted to added a column to the end of the table to add notes to it. However due to the newer information being combined into the table, a blank cell overwrites the notes cell in the last column when rows are combined. I found this macro which is great for removing duplicates, but I cant for the life of me get it to concatenate data in column AC during the combine process. Can anyone help me add a line to concatenate data in column AC?


    Thank you for any help!!!


    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Removing Duplicates in ColA Keep Unique Data in Column AC

    If you post a sample file as well with some data so I don't have to recreate it I'll have a look for you ...
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Registered User
    Join Date
    02-18-2016
    Location
    murica
    MS-Off Ver
    2010
    Posts
    4

    Re: Removing Duplicates in ColA Keep Unique Data in Column AC

    Hey MatrixMan thank you so much for offering your help. I have sunk so much time into this project and still cant wrap my head around it to make it work. If at all possible -- Column B-AA (the new data being combined in should always replace these columns). The prexisting data in columns AB,AC,AD should always remain. Thank you again for your help!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-18-2016
    Location
    murica
    MS-Off Ver
    2010
    Posts
    4

    Re: Removing Duplicates in ColA Keep Unique Data in Column AC

    Accidental Repost.
    Attached Files Attached Files
    Last edited by Ijustneedsomething; 03-24-2017 at 05:55 PM. Reason: Accidental repost

  5. #5
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Removing Duplicates in ColA Keep Unique Data in Column AC

    Hi - I think because you're using the properties of the scripting library to recognise the duplicates and replacing the first with the last on a wholesale basis, this code is not really suitable for "part replacing" a record conditionally. If what you're trying to do is to always keep the last three records, then all I could suggest is adjusting the last step to clear all except the last three columns (adjust the resize) and do a redim preserve on vVALS to lose the last three elements.
    Last edited by MatrixMan; 03-25-2017 at 04:49 AM.

  6. #6
    Registered User
    Join Date
    02-18-2016
    Location
    murica
    MS-Off Ver
    2010
    Posts
    4

    Re: Removing Duplicates in ColA Keep Unique Data in Column AC

    Hey MatrixMan,

    Thank you for your time again! It is much appreciated! That makes more sense but I am having issues adjusting the size. I have learned quite alot in the macro space over the course of this project but I still cannot wrap my head around readjusting the size of vVALS. Is there a better macro you could recommend or would you mind helping me readjust it? I found the macro below which I think may be better suited, however the issue I am having with this code, is that instead of clearing the table and pasting the array back into the table, it pastes it into a new sheet titled 'result', then causing me some difficulty getting the values back into the table. Let me know what your thoughts are, on whether I should just use a different macro all together or if I should just resize?

    Thank you again for your time! I am still trying to learn how to properly use these types of macros!

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Removing Duplicates in ColA Keep Unique Data in Column AC

    Hi - sorry to say I don't have a solution for you. I am not that familiar with the Scripting Dictionary and neither of these code snippets is how I would write a "duplicate find & replace" function. They seem quite rigid and overly complicated to me ... perhaps someone more familiar with their approach can help. Otherwise, I can rewrite the code from scratch but will need more sample data and:
    - confirmation that the duplicate is based on FirmName only (if not, what determines a duplicate).
    - are there only ever two possible duplicates or could there be more?
    - do the last three values ever get overwritten? if so - what are the rules?

+ 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. Removing duplicates, but retaining unique cells?
    By DouglasMacArthur in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-07-2016, 07:34 AM
  2. [SOLVED] Appending, sorting and removing duplicates of chunks of data per column
    By terryhenderson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-10-2015, 08:34 AM
  3. Removing duplicates Vs. only showing unique values
    By Terri Earley in forum Excel General
    Replies: 5
    Last Post: 07-06-2015, 01:33 AM
  4. Replies: 6
    Last Post: 03-29-2012, 12:16 AM
  5. Removing Duplicates in one column and summarizing data
    By guard23 in forum Excel General
    Replies: 5
    Last Post: 02-09-2012, 03:33 PM
  6. Removing Duplicates and Associated Unique Value
    By acsmith in forum Excel General
    Replies: 7
    Last Post: 08-17-2011, 10:42 AM
  7. merge data from array without removing column duplicates
    By aversluis in forum Excel General
    Replies: 3
    Last Post: 09-26-2007, 12:48 PM

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