I have developed a routine that splits a workbook and emails each of the newly created workbooks to a recipient.
I have a range within ThisWorkbook ("emails"
that contains an identifier and in the adjacent column, the email addresses. The email addresses would look like this for single recipients: jsmith and like this for multiple recipients: jsmith;jjones;another
My VBA code includes
This works fine except where I want to email to multiple recipients.I think I need something like:
SendTo = Array(r.Offset(0, 1).Value)
but this doesn't work I suspect because I am not properly populating the array.
Please help.
I have a range within ThisWorkbook ("emails"
My VBA code includes
Code:
sendto = r.Offset(0, 1).Value
EmailTitle = "Budget Monitoring Return " + r.Value
' need to trap invalid email addresses
On Error GoTo ErrorHandler
ActiveWorkbook.sendmail Recipients:=sendto, _
Subject:=EmailTitle, RETURNRECEIPT:=True
On Error GoTo 0
' reset workbook ready for next loop
ActiveWorkbook.Close
Next r
SendTo = Array(r.Offset(0, 1).Value)
but this doesn't work I suspect because I am not properly populating the array.
Please help.