Spread Windows Forms 15.0
GrapeCity.Spreadsheet Assembly / GrapeCity.Spreadsheet Namespace / IFormatConditions Interface / Add Method / Add(FormatConditionType,FormatConditionOperator,String,String,ContainsOperator,TimePeriods) Method
Specifies whether the conditional format is based on a cell value or an expression.
The conditional format operator. If type is FormatConditionType.TextString or FormatConditionType.Expression, it'll be ignored.
The value or expression associated with the conditional format. Can be a constant value, a string value, a cell reference, or a formula.
The value or expression associated with the second part of the conditional format when Operator is xlBetween or xlNotBetween (otherwise, this argument is ignored). Can be a constant value, a string value, a cell reference, or a formula.
The conditional format text operator. If type isn't FormatConditionType.TextString, it'll be ignored.
The date operator used in the format condition.


In This Topic
    Add(FormatConditionType,FormatConditionOperator,String,String,ContainsOperator,TimePeriods) Method
    In This Topic
    Adds a new conditional format.
    Syntax
    'Declaration
     
    
    Overloads Function Add( _
       ByVal type As FormatConditionType, _
       Optional ByVal operator As FormatConditionOperator, _
       Optional ByVal formula1 As String, _
       Optional ByVal formula2 As String, _
       Optional ByVal textOperator As ContainsOperator, _
       Optional ByVal dateOperator As TimePeriods _
    ) As IFormatCondition
    'Usage
     
    
    Dim instance As IFormatConditions
    Dim type As FormatConditionType
    Dim operator As FormatConditionOperator
    Dim formula1 As String
    Dim formula2 As String
    Dim textOperator As ContainsOperator
    Dim dateOperator As TimePeriods
    Dim value As IFormatCondition
     
    value = instance.Add(type, operator, formula1, formula2, textOperator, dateOperator)

    Parameters

    type
    Specifies whether the conditional format is based on a cell value or an expression.
    operator
    The conditional format operator. If type is FormatConditionType.TextString or FormatConditionType.Expression, it'll be ignored.
    formula1
    The value or expression associated with the conditional format. Can be a constant value, a string value, a cell reference, or a formula.
    formula2
    The value or expression associated with the second part of the conditional format when Operator is xlBetween or xlNotBetween (otherwise, this argument is ignored). Can be a constant value, a string value, a cell reference, or a formula.
    textOperator
    The conditional format text operator. If type isn't FormatConditionType.TextString, it'll be ignored.
    dateOperator
    The date operator used in the format condition.

    Return Value

    A IFormatCondition object that represents the new conditional format.
    Remarks
    Because formula1 and formula2 are also used for primitive value, the formula must start with "=".
    See Also