Share via


FormatCondition.Modify Method (Excel)

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.

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

See Also

Concepts

FormatCondition Object

FormatCondition Object Members