Match Emails to URLs

Sharid

Well-known Member
Joined
Apr 22, 2007
Messages
1,066
Office Version
  1. 2016
Platform
  1. 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
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi

Can anybody help on this, I am really stuck

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top