Modify Method (FormatCondition Object)
Applies To
FormatCondition object.
Description
Modifies an existing conditional format.
Syntax
expression.Modify(Type, Operator, Formula1, Formula2)
expression Required. An expression that returns a FormatCondition object.
Type Required Long. Specifies whether the conditional format is based on a cell value or an expression. Can be either of the following XlFormatConditionType constants: xlCellValue or xlExpression.
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. Can be a constant value, a string value, a cell reference, or a formula.
See Also
Add method (FormatConditions collection), Formula1 property, Formula2 property, Operator property.
Example
This example modifies an existing conditional format for cells E1:E10.
Worksheets(1).Range("E1:E10").FormatConditions(1) _
.Modify xlCellValue, xlLess, "=$a$1"