VBA to send outlook email to multiple recipients

Misoboii

New Member
Joined
Jun 26, 2017
Messages
25
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:

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:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
EDITS:

I have created a new sheet w all the emails.
Sheet name: emaillist
starts from row 2 onwards as row 1 is the header
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top