Hi there,
I have a code here that sends an email to 1 person.
However, i do not want to hard code the email in but instead i have a list of emails in a sheet (named: control) from cell V33:V40
here is my current code:
under the to =, i would like to refer to the range link in the sheet instead.
Thank you!
I have a code here that sends an email to 1 person.
However, i do not want to hard code the email in but instead i have a list of emails in a sheet (named: control) from cell V33:V40
here is my current code:
Code:
Sub Email()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
If ActiveWorkbook.Path <> "" Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "email details"
On Error Resume Next
With OutMail
.to = "intern1@test.com; intern2@test.com; intern3@test.com"
.CC = ""
.BCC = ""
.Subject = "Price Updates - " & Format(Date, "dd/mm/yyyy")
.HTMLBody = strbody
.Display 'or use .Send or .display to show in outlook wo sending
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Else
MsgBox "The ActiveWorkbook does not have a path, Save the file first."
End If
End Sub
under the to =, i would like to refer to the range link in the sheet instead.
Thank you!
Last edited: