I tried below options, but result is not as expected.
Option 1:
- Code: Select all
ConditionalFormatWrapper format1 = sheet.Range["A4:E10"].ConditionalFormats.AddCondition();
format1.FormatType = ConditionalFormatType.ContainsBlanks;
Option 2:
- Code: Select all
ConditionalFormatWrapper format1 = sheet.Range["A4:E10"].ConditionalFormats.AddCondition();
format1.FormatType = ConditionalFormatType.ContainsText;
format1.FirstFormula = "";
format1.Operator = ComparisonOperatorType.Equal;
format1.BackColor = Color.Red;