Share via


Validation.Modify Method

Modifies data validation for a range.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Sub Modify ( _
    Type As Object, _
    AlertStyle As Object, _
    Operator As Object, _
    Formula1 As Object, _
    Formula2 As Object _
)
'Usage
Dim instance As Validation
Dim Type As Object
Dim AlertStyle As Object
Dim Operator As Object
Dim Formula1 As Object
Dim Formula2 As Object

instance.Modify(Type, AlertStyle, Operator, _
    Formula1, Formula2)
void Modify(
    Object Type,
    Object AlertStyle,
    Object Operator,
    Object Formula1,
    Object Formula2
)

Parameters

  • Formula1
    Type: System.Object

    Optional Object. The first part of the data validation equation.

  • Formula2
    Type: System.Object

    Optional Object. 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.

Validation type

Arguments

xlInputOnly

AlertStyle, Formula1, and Formula2 are not used.

xlValidateCustom

Formula1 is required; Formula2 is ignored. Formula1 must contain an expression that evaluates to True when data entry is valid and False when data entry is invalid.

xlValidateList

Formula1 is required; Formula2 is ignored. Formula1 must contain either a comma-delimited list of values or a worksheet reference to the list.

xlValidateDate, xlValidateDecimal, xlValidateTextLength, xlValidateTime, or xlValidateWholeNumber

Formula1 or Formula2, or both, must be specified.

See Also

Reference

Validation Interface

Validation Members

Microsoft.Office.Interop.Excel Namespace