SendMail to multiple recipients, one variable, and one constant

C

Craig

I'm trying to use the SendMail command to send a workbook to two
people, one manager, and one employee, the employee is variable, but
the manager is constant, here's what i have right now

ActiveWorkbook.SendMail Recipients:=Array(myRecipient ,
"(e-mail address removed)") Subject:=("Assignments for " & myJob)

that current line is looking for an end of statement, so i'm sure i've
formatted something wrong, but everything i try will send the email to
myRecipient, but not (e-mail address removed), any ideas?
 
S

Simon Lloyd

Craig i have this that i use, it creates an input box so you can typ
the recipient, your welcome to use or modify it!

Sub Mail_SheetsArray()
Dim wb As Workbook
Dim strdate As String
Dim I2 As Integer
strdate = Format(Now, "dd-mm-yy hh-mm-ss")
Application.ScreenUpdating = False
ActiveWindow.SelectedSheets.Copy
Set wb = ActiveWorkbook
For I2 = 1 To 1 '[I have 1 to1 here so the box oly pops up once bu
you could change the end figure to suit]
t1 = InputBox("Enter E-mail Address", "Who To Send To?", "")
With wb
.SaveAs "ANYTHING" & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail t1 ', "This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next
Application.ScreenUpdating = True

End Su
 
R

Ron de Bruin

This is working for me with the address in A1

Dim myRecipient As String
myRecipient = Sheets("Sheet1").Range("A1").Value
ActiveWorkbook.SendMail Recipients:=Array(myRecipient, "(e-mail address removed)"), Subject:=("Assignments for ")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top