Hello guys! I got this VBA code from a colleague which he uses when sending multiple emails from Outlook. I don't have a programming background and I would like to ask for help on how to modify it. This code sends email based from the last cell. What I would like to do is send emails to all the recipients listed in column C. Column A will be the sender and column B will be email subject. Attached is the sample file.
Sub Mail_Outlook()
Dim OutApp As Object
Dim OutMail As Object
LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
If Cells(LastRow, 1).Value <> "" Then
MailTo = Cells(LastRow, 1).Offset(0, 2).Value
MailSubject = Cells(LastRow, 1).Offset(0, 1).Value
MailBody = "Regards," & vbNewLine & vbNewLine & "Sender Name"
'Send Mail
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(o)
With OutMail
.Subject = MailSubject
.To = MailTo
.body = MailBody
'.Attachments.Add FileNme
.Display
'.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End If
End Sub
Bookmarks