Hi All,
I have a long list of email addresses, all in random formats (ie. not your standard first.last@domain.com).
I also have a long list of 5k first names.
The macro needs to search each email address for a matching first name from 5k list and return the name when a match occurs. The logic is pretty straightforward:
1. Return a value if the email address STARTS with one of the names in the list of 5k names. For example:
2. In cases where more than one match exists, return the longest match. For example:
The email "danielle@gmail.com" would match with "dan", "daniel", and "danielle". In these cases, "Danielle" should be returned since it is the longest match.
3. If there is no match, the macro shouldn't return anything.
I tried accomplishing this using a formula and got pretty far, but can't get it to work fully. Thought I would ask the VBA experts out there if they can come up with a solution.
Any help is greatly appreciated!!
Thanks,
Glenn
I have a long list of email addresses, all in random formats (ie. not your standard first.last@domain.com).
I also have a long list of 5k first names.
The macro needs to search each email address for a matching first name from 5k list and return the name when a match occurs. The logic is pretty straightforward:
1. Return a value if the email address STARTS with one of the names in the list of 5k names. For example:
The email "chris@gmail.com" should return "Chris" but "merrychristmas@gmail.com" shouldn't return anything.
2. In cases where more than one match exists, return the longest match. For example:
The email "danielle@gmail.com" would match with "dan", "daniel", and "danielle". In these cases, "Danielle" should be returned since it is the longest match.
3. If there is no match, the macro shouldn't return anything.
I tried accomplishing this using a formula and got pretty far, but can't get it to work fully. Thought I would ask the VBA experts out there if they can come up with a solution.
Any help is greatly appreciated!!
Thanks,
Glenn