I am trying to create something to email folks that have received an error. I have gotten started on the code below but don’t know how to finish. I want the emails to be sent to their email address in column B. In the body of the email I want it to say Hello to their name in column A along with a short email that pulls the error in column C. I have it set to display the emails because I like to look at it before I hit the send button just to make sure. I would also like to just have this layout created so I can change the names and errors. How do I complete this with the code below?
Sub SendEmail_DualComp()
Dim EmailApp As Outlook.Application
Set EmailApp = New Outlook.Application
Dim EmailItem As Outlook.MailItem
Set EmailItem = EmailApp.CreateItem(olMailItem)
Dim SigString As String
Dim Signature, EmailTo, ccTo, subj, msg, Filepath As String
Dim ws As Worksheet
Dim Cel As Range
Dim LR As Long
Dim rng As Range
Set ws = Sheets("Sheet1")
EmailItem.To = ActiveSheet.Range("A1").Value
EmailItem.Subject = "Dual Compensation Audit Results 2021"
EmailItem.Body = "Good Morning," & vbNewLine & vbNewLine & "This is my first email from Excel" & _
vbNewLine & vbNewLine & _
"Thank You," & vbNewLine & vbNewLine & _
EmailItem.Display
On Error GoTo 0
Set Mail = Nothing
Set outApp = Nothing
End Sub
Sub SendEmail_DualComp()
Dim EmailApp As Outlook.Application
Set EmailApp = New Outlook.Application
Dim EmailItem As Outlook.MailItem
Set EmailItem = EmailApp.CreateItem(olMailItem)
Dim SigString As String
Dim Signature, EmailTo, ccTo, subj, msg, Filepath As String
Dim ws As Worksheet
Dim Cel As Range
Dim LR As Long
Dim rng As Range
Set ws = Sheets("Sheet1")
EmailItem.To = ActiveSheet.Range("A1").Value
EmailItem.Subject = "Dual Compensation Audit Results 2021"
EmailItem.Body = "Good Morning," & vbNewLine & vbNewLine & "This is my first email from Excel" & _
vbNewLine & vbNewLine & _
"Thank You," & vbNewLine & vbNewLine & _
EmailItem.Display
On Error GoTo 0
Set Mail = Nothing
Set outApp = Nothing
End Sub