Using a look up list to determine email address

irishr_ram

New Member
Joined
Jul 16, 2013
Messages
10
Hoping someone can help as seems easy but I cannot seem to get it working.

I have a VBA script setup to email a certain selection of cells which is all working fine. However at the moment the email address it sends it to is hard coded if you will and I want to have it determine the email address depending on the value of a certain cell.

So for example I have my lookup entry in C1 which says red so my table below would be

A B
Red dave@aol.com
Blue steve@aol.com
Green terence@aol.com

Result Cell = dave@aol.com

So in this example it would pull out dave@aol.com from the result cell

The code I am trying to get right is here

.Item.To = Lookups.Range("Result Cell").Value
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi

I did something similar at work which works on numbers by using Vlookup, i had a table of email addresses on one sheet and with the number next to the email, i then used a vlookup on the sheet where the emails to send is and this worked fine

Hope this helps

paul
 
Upvote 0
Hi

I did something similar at work which works on numbers by using Vlookup, i had a table of email addresses on one sheet and with the number next to the email, i then used a vlookup on the sheet where the emails to send is and this worked fine

Hope this helps

paul

Cheers and similar to what I am doing. So I have a separate Lookups Tab which has a list of names and email addresses next to them. Then I have another cell which is the results cell and basically looks up the name on the report and then pulls out the email address.

So can do this fine but then on my VBA I have this line ".Item.To = Range("F5").Value" which F5 has the resulting email address in but does not seem to work and just stops the VBA at the point where it is wanting me to enter an email address.
 
Upvote 0
If you are using the Outlook model for e-mails it is just .To=
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,770
Members
449,095
Latest member
m_smith_solihull

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