deenoseban
New Member
Hi ,
I tried to create an email set with below codes, but not able to get the format. The below is the sample data and code
the below is the result that I am looking for. But the % in red color (as figure is -ve)formatting is not working with my codes.
Revenue for the current month is 120 Previous month is 126 Variance is 4.8%
the below is the data set where email is drafted attached the sample file.
I tried to create an email set with below codes, but not able to get the format. The below is the sample data and code
Code:
Sub Report_email()
ActiveWorkbook.Save
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = "xoosi@galint.ae"
.CC = "Dava@galint.ae"
.BCC = ""
.HTMLBody = "Dear Xoosi," & "<br><br>" & _
"Please find the below analysis " & "<br><br>" & _
"Revenue for the current month is " & Range("B2") & " Previous month is " & Range("C2") & " Variance is "
.Display
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
the below is the result that I am looking for. But the % in red color (as figure is -ve)formatting is not working with my codes.
Revenue for the current month is 120 Previous month is 126 Variance is 4.8%
the below is the data set where email is drafted attached the sample file.
Attachments
Last edited by a moderator: