NVRensburg
Board Regular
- Joined
- Jul 1, 2014
- Messages
- 113
- Office Version
- 365
- 2016
- Platform
- Windows
Hi there
I have a long VBA to send emails based on a sheet. It works perfectly however I just need help modifying this part to add in the persons name from cell B2 after where is says .Body = "Good day," & vbLf & vbLf _
So the email will say Hi Jake with B2 showing the name Jake
' Prepare e-mail with PDF attachment
With OutlApp.CreateItem(0)
' Prepare e-mail
.Subject = Range("$C$2")
.To = Range("$C$3")
.Body = "Good day," & vbLf & vbLf _
& " " & vbLf _
& "Please find attached the latest version of the Workforce Planner." & vbLf & vbLf _
& "Should there be any changes from your side, or if something is incorrect, please reply to this email with the required changes so that I can edit the worksheet from my side." & vbLf _
& " " & vbLf & vbLf
.Attachments.Add PdfFile
.SentOnBehalfOfName = "abc@company.com"
' Try to send
I have a long VBA to send emails based on a sheet. It works perfectly however I just need help modifying this part to add in the persons name from cell B2 after where is says .Body = "Good day," & vbLf & vbLf _
So the email will say Hi Jake with B2 showing the name Jake
' Prepare e-mail with PDF attachment
With OutlApp.CreateItem(0)
' Prepare e-mail
.Subject = Range("$C$2")
.To = Range("$C$3")
.Body = "Good day," & vbLf & vbLf _
& " " & vbLf _
& "Please find attached the latest version of the Workforce Planner." & vbLf & vbLf _
& "Should there be any changes from your side, or if something is incorrect, please reply to this email with the required changes so that I can edit the worksheet from my side." & vbLf _
& " " & vbLf & vbLf
.Attachments.Add PdfFile
.SentOnBehalfOfName = "abc@company.com"
' Try to send