How do I change the color of a cell in Excel based on a Condition?
I want to change the color of a cell in Excel bases upon the text in the cell being the value "TRUE"
I tried this statement, but I get an error...can someone help me?
I am using Microsoft.Office.Interop.Excel
if (excelApp.Range[rowIndex, colIndex].Value = "TRUE")
{
excelApp.Range[rowIndex, colIndex].Interior.ColorIndex = 4;
}
else
{
excelApp.Range[rowIndex, colIndex].Interior.ColorIndex = 3;
}
thanks
J