FormatConditions.Add Method (Excel)
Published: July 16, 2012
Adds a new conditional format.
expression .Add(Type, Operator, Formula1, Formula2)
expression A variable that represents a FormatConditions object.
Parameters
|
Name |
Required/Optional |
Data Type |
Description |
|---|---|---|---|
|
Type |
Required |
. Specifies whether the conditional format is based on a cell value or an expression. |
|
|
Operator |
Optional |
Variant |
The conditional format operator. Can be one of the following XlFormatConditionOperator constants: xlBetween, xlEqual, xlGreater, xlGreaterEqual, xlLess, xlLessEqual, xlNotBetween, or xlNotEqual. If Type is xlExpression, the Operator argument is ignored. |
|
Formula1 |
Optional |
Variant |
The value or expression associated with the conditional format. Can be a constant value, a string value, a cell reference, or a formula. |
|
Formula2 |
Optional |
Variant |
The value or expression associated with the second part of the conditional format when Operator is xlBetween or xlNotBetween (otherwise, this argument is ignored). Can be a constant value, a string value, a cell reference, or a formula. |
Return Value
A FormatCondition object that represents the new conditional format.