PDA

View Full Version : Delete duplicates based on partial match



joshworl10
08-21-2018, 06:46 AM
Hi,

I'm trying to delete out rows from "sheet 1" when the name in column C contains the same words as a list on "sheet 2" in column C. The issue is that the data pulled into column C on "sheet 1" changes slightly every time however the key first word or two I have recorded in "sheet 2" column C.

For example:

"sheet 1" column C could pull "John Smith asset management" or "XYZ asset managemen" or any number of small variations to the same name

"sheet 2" column C would have "John Smith"

Is there a script that could run through both columns and locate partial matches and could delete the values that have no matches at all out of the table in "sheet 1"?


Any help appreciated thx

p45cal
08-21-2018, 07:29 AM
Supply a simple workbook with those things in place to save us having to do it, and to save us making silly assumptions.

joshworl10
08-21-2018, 10:33 AM
Supply a simple workbook with those things in place to save us having to do it, and to save us making silly assumptions.


Attached is a mini sample. The real sheet just has more rows in the same column but the script should be the same. Thanks

22750

p45cal
08-21-2018, 05:55 PM
In the attached workbook, 3 solutions, 3 techniques, 3 buttons.
While these all work in the attached, they're very unlikely to work in the real world because I strongly suspect the sheets are quite unlike your real sheets. I'd guess there's more data across the sheets in both sheets (and my code may overwrite some of that data), that they may not start in rows 4 and 3, and there could be headers on the real world sheet(s) (this is a very important difference for the advanced filter techniques).
Some of the macros only copy a single column.

Anyway, it'll show you that it's possible but it'll need tweaking.

joshworl10
08-22-2018, 05:37 AM
Thank you so much this'll save so much time