Consulting

Results 1 to 5 of 5

Thread: Delete duplicates based on partial match

  1. #1

    Delete duplicates based on partial match

    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

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Supply a simple workbook with those things in place to save us having to do it, and to save us making silly assumptions.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Quote Originally Posted by p45cal View Post
    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

    Holders Macro Sample.xlsx

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    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.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    Thank you so much this'll save so much time

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •