Show AllShow All

Modify Method (Validation Object)

Modifies data validation for a range.

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

expression    Required. An expression that returns a Validation object.

Type   Required XlDVType. The validation type.

AlertStyle   Optional XlDVAlertStyle. The validation alert style.

Operator   Optional XlFormatConditionOperator. The data validation operator.

Formula1    Optional Variant. The first part of the data validation equation.

Formula2    Optional Variant. The second part of the data validation when Operator is xlBetween or xlNotBetween (otherwise, this argument is ignored).

Remarks

The Modify method requires different arguments, depending on the validation type, as shown in the following table.

Example

This example changes data validation for cell E5.

Range("e5").Validation _
    .Modify xlValidateList, xlValidAlertStop, _
    xlBetween, "=$A$1:$A$10"