LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
Extract domain names from email IDs sl24 Excel Worksheet Functions 2 August 21st 07 05:05 PM
Email worksheet from a list of names and email Rookie_User Excel Discussion (Misc queries) 1 December 3rd 06 07:56 PM
add email address to a list of names biochemist Excel Discussion (Misc queries) 5 May 17th 05 05:17 PM
splitting names & email add. Cheker Excel Programming 5 October 6th 04 06:15 AM


All times are GMT +1. The time now is 05:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"