我有以下函數= AND(EXACT(B3; F3); EXACT(F3; J3)),它返回TRUE或FALSE。 我想創建一個單元格規則,用於將假的和綠色的真實值着色爲紅色。 試圖使用下面的代碼,但不工作,我做錯了什麼?高亮顯示單元格規則文本包含
Excel.FormatConditions fcs = xlWorkSheet.Cells[i,"M"].FormatConditions;
Excel.FormatCondition fc = (Excel.FormatCondition)fcs.Add(Excel.XlFormatConditionType.xlTextString, Excel.XlFormatConditionOperator.xlEqual, "TRUE");
Excel.Interior interior = fc.Interior;
interior.Color = ColorTranslator.ToOle(Color.LightGreen);
Excel.Font font = fc.Font;
font.Color = ColorTranslator.ToOle(Color.ForestGreen);
fc = (Excel.FormatCondition)fcs.Add(Excel.XlFormatConditionType.xlTextString, Excel.XlFormatConditionOperator.xlEqual, "FALSE");
interior.Color = ColorTranslator.ToOle(Color.LightSalmon);
font.Color = ColorTranslator.ToOle(Color.Red);
允許@ chewmewaba4寫他/她想要的。 – varocarbas