Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use variable as email reipient names
I am attempting to read a list of email addresses into a variable and then
use that variable in the SendMail function. If I use hard coded email addresses all is fine, but when I try to store the names in the variable and use the variable it errors out. Here is my code: Dim strRecipients As String 'other variables defined While varCurRow < varLastRow + 1 'read the list of email recipients Sheets("Email Recipients").Range("A" & varCurRow).Select If strRecipients = "" Then strRecipients = "'" & Sheets("Email Recipients").Range("A" & varCurRow).Value 'strRecipients = """ & range.("A3").Value & """ Else strRecipients = strRecipients & """, """ & Sheets("Email Recipients").Range("A" & varCurRow).Value End If varCurRow = varCurRow + 1 'cntr = cntr + 1 Wend ActiveWorkbook.SendMail Array(strRecipients), "Just a Test", "Testing Code Only" Any help is appreciated. Mr B |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
converting email address names in a range of cells to real names | Excel Worksheet Functions | |||
Extract domain names from email IDs | Excel Worksheet Functions | |||
Email worksheet from a list of names and email | Excel Discussion (Misc queries) | |||
add email address to a list of names | Excel Discussion (Misc queries) | |||
splitting names & email add. | Excel Programming |