I need a macro or sub routine to get text for the body of a email using this code
I need for GetText to be the cell contents of the cell immediately left (0,-1) of every cell that containts exactly "r".
Sometimes it is only one cell sometimes it is 10. but i need each cell be copied and pasted into the body of the email.
Any solutions? I was unable to find anything.
Code:
Sub SendMail()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "joe@whatever.com"
.cc = ""
.BCC = ""
.Subject = "checklist"
.Body = GetText
.attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error Goto 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Sometimes it is only one cell sometimes it is 10. but i need each cell be copied and pasted into the body of the email.
Any solutions? I was unable to find anything.
Last edited: