Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email from excel using vba using the email address from an excel sheet 1

Status
Not open for further replies.

diehippy

Technical User
Jul 4, 2007
46
GB
Hi all,

I have looked everywhere for some vba code to email from excel picking up the email address from an excel work sheet can any one help, I would be most grateful

Many Thanks
 



You cannot do this...
Code:
Dim r As Range
Set r = Range(Cells(4, "E"), Cells(4, "E").End(xlDown))


'.......


        sendto = r.Value
This is what the MakeList function is for: to make a string of all the values in a range. .sendto wants a string, not a range!


I thought you wanted to send ONE EMAIL AT A TIME!!!
Code:
Dim r As Range

For each r in Range(Cells(4, "E"), Cells(4, "E").End(xlDown))
'...
   sendto = r.value
'...
Next


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi Skip,

It works, that is brillant, I can not thank you enough for this, I thought I was going to lose my mind (hopefully not) can I use a simlar range code for creating the filename as I need to use the selected cells data from the third sheet

Many Thanks again you have been a absolute star

Diehippy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top