VBA Code to send multiple emails to individuals in rows

brendangooden

New Member
Joined
Sep 25, 2015
Messages
3
Good Evening All,

I'm new to this forum, so thanks for reading my question!

I have a sheet of data, with 8 columns of data.

Column A and B have recipient information (Name and Email Address)

Column C,D,E,F and G have information that i would like put into an email, to the person listed in Col A and B.

In other words, one email per row, with [different] data from 6 columns being entered into each email.

A screenshot is attached, of how the spreadsheet is formatted, and how I would like the email to be formatted.

Thanks a lot for any help!

Brendan

yujbfiyAgbcwAy0EeuzcfVkA6rP86Z4RvL91lEUocXY


APsuSvryEgru4ajLaCklgLObxFUVfAjw_xwxnFQ2YBE
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Firstly, can't see the screenshot..
But where does the info in Cols C-G go in the email ?

If you can't get a response because of the screenshot, try uploading to dropbox for us to view....
Oh, and welcome to the Forum !!
 
Upvote 0
I have to BBQ and drink chardy, so I'm not allowed to play on coding at the moment....mainly 'cause I'll stuff it up !!.
Can you upload the worksheet to Dropbox rather than a picture....and I'll try and get a look at it in the morning before golf !!
 
Upvote 0
Hi Friends,
I have a scenario where I need to automate sending emails from excel from a column with corresponding row value in a body of email, if some condition is true.But the problem is before sending emails i need to check for duplicate emails and send. But the code i have send multiple emails to same recipient.

Sub Create_Mail_From_List()
' Works in Excel 2000, Excel 2002, Excel 2003, Excel 2007, Excel 2010, Outlook 2000, Outlook 2002, Outlook 2003, Outlook 2007, and Outlook 2010.
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range


Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")


On Error GoTo cleanup
For J = 1 To ActiveSheet.UsedRange.Columns.Count - 1
If Cells(J, 74).Value Like "Yes" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Cells(J, 52).Value
.Subject = "REMINDER - Risk Overdue Alert"
.Body = "Dear " & Cells(J, 7).Value _
& vbNewLine & vbNewLine & _
Cells(J, 7).Value _
& Cells(J, 7).Value _
& vbNewLine & vbNewLine & _
"Please contact us to discuss bringing " & _
"your account up to date"



'You can also add files like this:
'.Attachments.Add ("C:\test.txt")

.Send 'Or use Display.
End With

On Error GoTo 0
Set OutMail = Nothing
End If
Next J


cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,679
Members
449,463
Latest member
Jojomen56

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