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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Recipients from excel column

Status
Not open for further replies.

Jeepers321

Technical User
Oct 17, 2000
17
US
I have a column of email addresses on sheet3 and I need to send this workbook as an attachment to all the addresses in that column. Can anyone give me some hints on how to get started. I was going to have the workbook open with a form that has two command buttons on them one to send the e-mail and the other to cancel. For the life of me I just can't figure the array that I need to gather my list.
 
is this a one-off job? if so, i'd just use the CONCATENATE function to gather all the addresses into one cell and paste that value into your email TO: line

Cell A1: one@any.com
Cell A2: two@any.com
Cell B1: ;

Cell C1: =CONCATENATE(A1,B1,A2)
Cell C1: one@any.com; two@any.com
 
Not really.
Let me try and explain it this way.
| A | B | C
1|One@any.com|Type1|Place1
2|Two@any.com|Type2|Place2
3|Thr@any.com|Type3|Place3

When I click my button I need my code to send out seperate multiple e-mails.

take the first record and then
take the text from cell B1 and copy that text into cell Sheet2!F1,
take the text from Cell C1 and copy that text into cell Sheet1!F2
take the e-mail address from cell A1, open an e-mail and put that address in the recipients field
then send the message.
Loop until it reaches the last record.

I am using the vlookup function to place my records in the proper cells but I am just not sure how to loop through the rows. I am also using named ranges if that helps any.
 
To loop thru cells I always set a variable to the cell:

For n = 1 to 20
Set curcell = worksheets(1).cells(n,1)
emailaddress = curcell.value
sendemail(emailaddress)
next n


Will loop thru cells A1 to A20, take the email address and call the sendemail function with the email address.

(To explain my weird variables. I always use "n" for loops cos on the Spectrum, you could just hit "n" twice and you'd get "NEXT n". Curcell is short for current cell.)[sadeyes]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top