Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,066
- Office Version
- 2016
- Platform
- Windows
I have a list of emails, I need to link them to the correct URLs. Problem is there are too many to do manual.
I was hoping for some vba code that would MATCH part of the string in the EMAIL to that of the URL and place it in the next column/s
Example
Sheet1 column A has all the urls
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]URLs
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Whatcar.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Autotrader.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.CarGURU.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Automart.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.MotorWorld.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Sheet2 Column A has all the Emails
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Emails
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JohnDoe@whatcar.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JoeBlogs@MotorMadness.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneBlogs@MotorMadness.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneBlogs@MotorWorld.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneDoe@Whatcar.com
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Info@Autotrader.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneDoe@BillysCars.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contact@CarGuru.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bill@MedicalGuru.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jane@LifeStyleGuru.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Info@Martfury.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Info@AutoMart.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
When the code is run it will link the Emails from Sheet2 to that of the URLs on Sheet 1. I understand that this may not work 100% correct,however it will link the bulk of the emails.
Some emails may have a simmilar string to that of the url, the second email goes into the next column, I can then look at these few individually.
So it will look like this when the codes is run
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]URLS
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Whatcar.co.uk
[/TD]
[TD]JohnDoe@whatcar.co.uk[/TD]
[TD]JaneDoe@Whatcar.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Autotrader.co.uk
[/TD]
[TD]Info@Autotrader.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.CarGURU.co.uk
[/TD]
[TD]Contact@CarGuru.co.uk[/TD]
[TD]Bill@MedicalGuru.co.uk[/TD]
[TD]Jane@LifeStyleGuru.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Automart.co.uk
[/TD]
[TD]Info@AutoMart.co.uk[/TD]
[TD]Info@Martfury.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.MotorWorld.co.uk
[/TD]
[TD]JaneBlogs@MotorWorld.co.uk[/TD]
[TD]JaneBlogs@MotorMadness.co.uk[/TD]
[TD]JoeBlogs@MotorMadness.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
IF POSSIBLE, the closest email MATCH to the url needs to go into column B Sheet1,
Any UNMATCHED EMAILS in Sheet2 are then highlighted in RED. This is because although I might have the URLs some emails are either Gmail, Yahoo, Hotmail etc. I can then look at these one at a time
Thanks
I was hoping for some vba code that would MATCH part of the string in the EMAIL to that of the URL and place it in the next column/s
Example
Sheet1 column A has all the urls
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]URLs
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Whatcar.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Autotrader.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.CarGURU.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Automart.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.MotorWorld.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Sheet2 Column A has all the Emails
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Emails
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JohnDoe@whatcar.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JoeBlogs@MotorMadness.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneBlogs@MotorMadness.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneBlogs@MotorWorld.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneDoe@Whatcar.com
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Info@Autotrader.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JaneDoe@BillysCars.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Contact@CarGuru.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bill@MedicalGuru.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jane@LifeStyleGuru.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Info@Martfury.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Info@AutoMart.co.uk
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
When the code is run it will link the Emails from Sheet2 to that of the URLs on Sheet 1. I understand that this may not work 100% correct,however it will link the bulk of the emails.
Some emails may have a simmilar string to that of the url, the second email goes into the next column, I can then look at these few individually.
So it will look like this when the codes is run
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]URLS
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Whatcar.co.uk
[/TD]
[TD]JohnDoe@whatcar.co.uk[/TD]
[TD]JaneDoe@Whatcar.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Autotrader.co.uk
[/TD]
[TD]Info@Autotrader.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.CarGURU.co.uk
[/TD]
[TD]Contact@CarGuru.co.uk[/TD]
[TD]Bill@MedicalGuru.co.uk[/TD]
[TD]Jane@LifeStyleGuru.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.Automart.co.uk
[/TD]
[TD]Info@AutoMart.co.uk[/TD]
[TD]Info@Martfury.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]http://www.MotorWorld.co.uk
[/TD]
[TD]JaneBlogs@MotorWorld.co.uk[/TD]
[TD]JaneBlogs@MotorMadness.co.uk[/TD]
[TD]JoeBlogs@MotorMadness.co.uk[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
IF POSSIBLE, the closest email MATCH to the url needs to go into column B Sheet1,
Any UNMATCHED EMAILS in Sheet2 are then highlighted in RED. This is because although I might have the URLs some emails are either Gmail, Yahoo, Hotmail etc. I can then look at these one at a time
Thanks