Class DataValidationRuleCollection

A collection of DataValidationRule instances in a worksheet.

See

Worksheet.dataValidationRules

Hierarchy

Hierarchy

  • Base
    • DataValidationRuleCollection

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get count(): number
  • Gets the number of data validation rules applied on the worksheet.

    Returns number

Methods

  • Applies an AnyValueDataValidationRule to a WorksheetCell.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the 'cell' already has a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the 'cell' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an AnyValueDataValidationRule to the cells in a WorksheetRegion.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'region' is null.

    Throws

    ArgumentException Occurs when the 'region' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' already have a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an CustomDataValidationRule to a WorksheetCell.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the 'cell' already has a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the 'cell' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an CustomDataValidationRule to the cells in a WorksheetRegion.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'region' is null.

    Throws

    ArgumentException Occurs when the 'region' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' already have a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies a data validation rule to the a set of references.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'references' is null.

    Throws

    ArgumentException Occurs when the 'references' are from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'references' collection are in the totals row of a table.

    Parameters

    Returns void

  • Applies a data validation rule to the a set of references.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'references' is null.

    Throws

    ArgumentException Occurs when the 'references' are from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when 'overwriteExistingRules' is False and the one or more of the cells in the 'references' collection already have a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'references' collection are in the totals row of a table.

    Parameters

    • rule: DataValidationRule

      The data validation rule to apply to the set of references.

    • references: WorksheetReferenceCollection

      The reference to which the data validation rule should be applied.

    • overwriteExistingRules: boolean

      Indicates whether cells in the references collection which already have data validation rules should have the rules overwritten.

    Returns void

  • Applies an ListDataValidationRule to a WorksheetCell.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the 'cell' already has a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the 'cell' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an ListDataValidationRule to the cells in a WorksheetRegion.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'region' is null.

    Throws

    ArgumentException Occurs when the 'region' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' already have a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an OneConstraintDataValidationRule to a WorksheetCell.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the 'cell' already has a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the 'cell' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an OneConstraintDataValidationRule to the cells in a WorksheetRegion.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'region' is null.

    Throws

    ArgumentException Occurs when the 'region' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' already have a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an TwoConstraintDataValidationRule to a WorksheetCell.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the 'cell' already has a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the 'cell' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Applies an TwoConstraintDataValidationRule to the cells in a WorksheetRegion.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Throws

    ArgumentNullException Occurs when 'region' is null.

    Throws

    ArgumentException Occurs when the 'region' is from a worksheet other than this collection.

    Throws

    ArgumentException Occurs when the 'rule' already applied to another worksheet.

    Throws

    ArgumentException Occurs when the 'rule' is invalid based on its rule type's requirements.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' already have a data validation rule applied to it.

    Throws

    ArgumentException Occurs when the one or more of the cells in the 'region' is a total cell of a table.

    See

    add

    Parameters

    Returns void

  • Removes all data validation rules from the worksheet.

    Returns void

  • Determines whether the specified data validation rule exists on the worksheet.

    Returns

    True if the rule is applied to one or more cells on the Worksheet; False otherwise.

    Parameters

    Returns boolean

  • Determines whether the specified cell has a data validation rule applied to it.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Returns

    True if the cell has a data validation rule applied; False otherwise.

    Parameters

    Returns boolean

  • Determines whether the specified references collection has a data validation rule applied to any of it's cells.

    Throws

    ArgumentNullException Occurs when 'references' is null.

    Throws

    ArgumentException Occurs when the 'references' are from a worksheet other than this collection.

    Returns

    True if the any cell from the references collection has a data validation rule applied; False otherwise.

    Parameters

    Returns boolean

  • Determines whether the specified region has a data validation rule applied to any of it's cells.

    Throws

    ArgumentNullException Occurs when 'region' is null.

    Throws

    ArgumentException Occurs when the 'region' is from a worksheet other than this collection.

    Returns

    True if the any cell from the region has a data validation rule applied; False otherwise.

    Parameters

    Returns boolean

  • Parameters

    • other: any

    Returns boolean

  • Find the data validation rule applied to the specified cell.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Returns

    A DataValidationRule-derived instance or null if the cell has no rule applied.

    Parameters

    Returns DataValidationRule

  • Gets a collection of all the references which have the specified or an equivalent rule applied to them.

    Returns

    A collection of references in the worksheet with a rule applied to it that is equivalent to the specified 'rule'.

    Parameters

    Returns WorksheetReferenceCollection

  • Returns number

  • Removes the data validation rule form the cell if one is applied.

    If the rule is only applied to the specified cell, it will be removed from the collection.

    Throws

    ArgumentNullException Occurs when 'cell' is null.

    Throws

    ArgumentException Occurs when the 'cell' is from a worksheet other than this collection.

    Returns

    True if the data validation rule was found and removed from the cell; False if the cell had no data validation rule applied.

    Parameters

    • cell: WorksheetCell

      The cell which should have its data validation rule cleared.

    Returns boolean

  • Removes the data validation rule form all cells in the specified collection.

    If any rules in the collection are not applied to any cells after this operation, they will be removed from the collection.

    Throws

    ArgumentNullException Occurs when 'references' is null.

    Throws

    ArgumentException Occurs when the 'references' are from a worksheet other than this collection.

    Returns

    True if the data validation rule was found and removed from any cells in the collection; False if the cells had no data validation rule applied.

    Parameters

    Returns boolean

  • Removes the data validation rule form all cells in the specified region.

    If any rules in the collection are not applied to any cells after this operation, they will be removed from the collection.

    Throws

    ArgumentNullException Occurs when 'region' is null.

    Throws

    ArgumentException Occurs when the 'region' is from a worksheet other than this collection.

    Returns

    True if the data validation rule was found and removed from any cells in the region; False if the region had no data validation rule applied.

    Parameters

    • region: WorksheetRegion

      The region which should have its data validation rules cleared.

    Returns boolean

  • Removes the specified rule from the worksheet.

    Throws

    ArgumentNullException Occurs when 'rule' is null.

    Returns

    True if the rule was contained on the Worksheet before removal; False otherwise.

    Parameters

    Returns boolean

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Returns void