I have this code to send an email (not my own work - I flogged it). In the body, I'd like to add carriage returns and use more cell references for additional lines to this email.
If someone could enlighten me on how to adjust my code, that'd be fantastic.
If someone could enlighten me on how to adjust my code, that'd be fantastic.
VBA Code:
Sub Email()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Set rng = Nothing
On Error Resume Next
Set rng = Selection.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
Exit Sub
End If
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Range("c350")
.CC = ""
.BCC = ""
.Subject = Range("c351")
.Body = Range("c354")
.Display
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub