jimmisavage
Board Regular
- Joined
- Jun 28, 2017
- Messages
- 130
Hi all,
I've got an excel VBA running to send an email based on the text inside a range of cells, this works fine. What I would like to do is change it slightly so if the cell is blank is skips it rather then leaving a blank row in me email.
As a side note, I can choose my font as Arial but not as Franklin Gothic Book - how would I do that? font-family:Franklin Gothic Book doesn't work
Thanks in advance for the help
I've got an excel VBA running to send an email based on the text inside a range of cells, this works fine. What I would like to do is change it slightly so if the cell is blank is skips it rather then leaving a blank row in me email.
As a side note, I can choose my font as Arial but not as Franklin Gothic Book - how would I do that? font-family:Franklin Gothic Book doesn't work
VBA Code:
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
eBody = "<BODY style=font-size:10.0pt;font-family:Arial>" & Cells(i, 8) & "<br>" & Cells(i, 9) & "<br>" & Cells(i, 10) & "<br>" & Cells(i, 11) & "<br>" & Cells(i, 12) & "<br>" & Cells(i, 13) & "<br>" & Cells(i, 14) & "<br>" & Cells(i, 15) & "<br>" & Cells(i, 16) & "<br>" & Cells(i, 17) & "</font>"
toList = Cells(i, 3)
ccList = Cells(i, 4)
eSubject = Cells(i, 7)
On Error Resume Next
With OutMail
.To = toList
.CC = ccList
.BCC = ""
.Subject = eSubject
.Display
End With
With OutMail
.HTMLBody = eBody & vbNewLine & .HTMLBody
.Send
End With
Thanks in advance for the help