Message 1 of 4
Revit API - Change Text color in excel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I’m exporting schedules to excel and then I want to compare the value of 2 cells. If they are not equal then change the font to red. I’m able to format the font to bold, but don’t know how to change the color.
thanks for any help.
xlRange = xlWorkSheet.get_Range("B4");
xlRange2 = xlWorkSheet.get_Range("J4");
if (xlRange.Value.ToString() != xlRange2.Value.ToString())
{
xlRange = xlWorkSheet.get_Range("J4");
xlRange.Font.Bold = true;
xlRange.Font.Color = "Red";
}