Share via


FormatCondition.Modify Method

Excel Developer Reference

Modifies an existing conditional format.

Syntax

expression.Modify(Type, Operator, Formula1, Formula2)

expression   A variable that represents a FormatCondition object.

Parameters

Name Required/Optional Data Type Description
Type Required XlFormatConditionType Specifies whether the conditional format is based on a cell value or an expression.
Operator Optional Variant An XlFormatConditionOperator value that represents the conditional format operator. This parameter is ignored if Type is set to xlExpression.
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 conditional format. Can be a constant value, a string value, a cell reference, or a formula..

Example

This example modifies an existing conditional format for cells E1:E10.

Visual Basic for Applications
  Worksheets(1).Range("e1:e10").FormatConditions(1) _
    .Modify xlCellValue, xlLess, "=$a$1"

See Also