If you want some simple VBA code that sends an email using outlook and has your current excel spreadsheet attached, look no further….
Dim Email As Variant
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
.To = "firstname.lastname@example.org;email@example.com"
.cc = "firstname.lastname@example.org;email@example.com"
.Subject = "Subject Line of Your email goes here"
.Body = "Hello," & vbLf & vbLf & "Please find attached the latest amazing report." & vbLf & vbLf & "Kind Regards," & vbLf & vbLf & "Excel Teacher"
Set OutMail = Nothing
Set OutApp = Nothing
You can adjust the contents between the inverted commas after the
Note that email addresses are separated using a semi-colon.
You may notice that we have split our email body text used the
vbLf (Line Feed) code. You could also use
vbCr (Carriage Return) or
vbCrLf (Carriage Return Line Feed)This makes the subsequent text drop down a line. 2 of these together creates a blank row to make the email look nicer.