FormatConditionCollection.Add

FormatConditionCollection.Add method

Adds a formatting condition and effected cell rang to the FormatConditions The FormatConditions can contain up to three conditional formats. References to the other sheets are not allowed in the formulas of conditional formatting.

public int[] Add(CellArea cellArea, FormatConditionType type, OperatorType operatorType, 
    string formula1, string formula2)
ParameterTypeDescription
cellAreaCellAreaConditional formatted cell range.
typeFormatConditionTypeType of conditional formatting.It could be one of the members of FormatConditionType.
operatorTypeOperatorTypeComparison operator.It could be one of the members of OperatorType.
formula1StringThe value or expression associated with conditional formatting.
formula2StringThe value or expression associated with conditional formatting

Return Value

[0]:Formatting condition object index;[1] Effected cell rang index.

See Also