Consulting

Results 1 to 4 of 4

Thread: Removing uncommon entries between two lists of names+data

  1. #1

    Removing uncommon entries between two lists of names+data

    I have two long lists of names with associated data for each name from which I want to remove names that aren't common to both lists.

    I need something that can take me from this:

    Name A B C D E F G H Name A B C D E F G H
    Jeff Smith x x x x x x x x Jeff Smith x x x x x x x x
    Sue Jones x x x x x x x x Mike Jones x x x x x x x x
    Bill Williams x x x x x x x x Meg Moore x x x x x x x x
    Meg Moore x x x x x x x x
    Joe West x x x x x x x x

    To this:

    Name A B C D E F G H Name A B C D E F G H
    Jeff Smith x x x x x x x x Jeff Smith x x x x x x x x
    Meg Moore x x x x x x x x Meg Moore x x x x x x x x

    If it helps, the names for list one are in column Q, and the data for these names goes from columns R to AA. The names for list two are in column AC, and the data for those names goes from columns AD to AM. First list goes down to row 4014, second list goes down to row 369

    Additional wrinkle: the names in each list might not be formatted exactly the same. For instance Jeff Smith might be in both lists, but in one he could show up as Jeff R. Smith and in the other just Jeff Smith. Another possibility: Jeffrey Smith vs. Jeff Smith. However, in both lists, it is always Firstname Lastname, never Lastname comma Firstname.

    I've tried several looping macros, some based around 'If InStr' and some based around the Lookup function, can't seem to get them right.

    Thank you in advance for any help you can provide!

  2. #2
    Have you by chance also asked this in other forums? If so, in all forums mention this and have a hyperlink to these other forums.

  3. #3
    Quote Originally Posted by jolivanes View Post
    Have you by chance also asked this in other forums? If so, in all forums mention this and have a hyperlink to these other forums.
    Can do. Also posted here: https://www.mrexcel.com/forum/excel-...ames-data.html

  4. #4
    VBAX Newbie
    Joined
    Mar 2018
    Posts
    2
    Location
    What about running a sql statement, (I'd say do a query for this) but you can always run a sql in vba. What I'm thinking is like if first name in recordset x like select left(first Nam, 4) from recordset x and then compare the last name. Don't quite know how to word this properly and the autocorrect on my phone is ****ing me off sry lol

    Edit: You can use access to generate the Sql statement for you by using the find duplicates wizard

Posting Permissions

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