Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,227
- Office Version
- 2010
- Platform
- Windows
Hi Hope you can help me please i have the code below where it sends seperate bulk emails, but i want it to lookup the 'To' email address and find it in cell F then copy from G to L and paste in the body.
VBA Code:
Private Sub CommandButton1_Click()
Dim i As Integer, Mail_Object, Email_Subject, o As Variant, lr As Long
lr = Cells(Rows.Count, "B").End(xlUp).Row
Set Mail_Object = CreateObject("Outlook.Application")
For i = 2 To lr
With Mail_Object.CreateItem(o)
.Subject = Range("D2").Value
.To = Range("B" & i).Value
.CC = Range("C" & i).Value
.Body = Range("E2").Value
'.Send
.display 'disable display and enable send to send automatically
End With
Next i
MsgBox "E-mail successfully sent", 64
Application.DisplayAlerts = False
Set Mail_Object = Nothing
End Sub