Replace method in an outlook template from excel

xenedra13

Board Regular
Joined
Aug 15, 2014
Messages
58
I am creating a macro that writes and sends emails based on information in an excel worksheet. I am using the following line to replace different placeholders in an outlook template:
Code:
MyItem.HTMLBody = Replace(MyItem.HTMLBody, "PLACEHOLDER", FormatType(Range("J6"), 0))
I need to add a new line of this code, but I need to add an if statement that determines if cell 1 is greater than cell 2 and if cell 2 is greater than cell 3. If it's higher, then I need to replace the placeholder with "higher" and make it bold and green. If it's lower then I need to replace it with "lower" and make it bold and red. I can do the if statement, but I am not sure how to go about making the text bold and colored based on the outcome of the if statement. Can somebody help me out with this? Thanks!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,223,247
Messages
6,171,004
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top