Represents a rectangular region of cells on a worksheet.

Hierarchy

Hierarchy (view full)

Implements

Constructors

  • Parameters

    • worksheet: Worksheet
    • firstRow: number
    • firstColumn: number
    • lastRow: number
    • lastColumn: number

    Returns WorksheetRegion

  • Parameters

    • worksheet: Worksheet
    • firstRow: number
    • firstColumn: number
    • lastRow: number
    • lastColumn: number
    • addCachedRegion: boolean

    Returns WorksheetRegion

  • Parameters

    • Rest ..._rest: any[]

    Returns WorksheetRegion

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get firstColumn(): number
  • Gets the index of the first column in the region. The index of the first column in the region.

    Returns number

  • get firstRow(): number
  • Gets the index of the first row in the region. The index of the first row in the region.

    Returns number

  • get lastColumn(): number
  • Gets the index of the last column in the region. The index of the last column in the region.

    Returns number

  • get lastRow(): number
  • Gets the index of the last row in the region. The index of the last row in the region.

    Returns number

  • get worksheet(): Worksheet
  • Gets the worksheet on which the region resides. The worksheet on which the region resides or null if the region has been shifted off the worksheet.

    Returns Worksheet

Methods

  • Returns EnumeratorWrapper<WorksheetCell>

  • Applies a array formula to the region of cells.

    'value' is parsed based on the [[CellReferenceMode]] of the [[Workbook]] to which the region belongs. If the region's [[worksheet]] has been removed from its parent collection, the A1 CellReferenceMode will be used to parse the formula.

    Throws

    [[ArgumentNullException]] 'value' is null or empty.

    Throws

    [[FormulaParseException]] 'value' is not a valid formula.

    Throws

    [[InvalidOperationException]] The region contains another array formula or data table which extends outside the region.

    See

    [[ArrayFormula]]

    Parameters

    • value: string

      The array formula to parse and apply to the region.

    Returns void

  • Applies a formula to the region of cells.

    'value' is parsed based on the [[CellReferenceMode]] of the [[Workbook]] to which the region belongs. If the region's [[worksheet]] has been removed from its parent collection, the A1 CellReferenceMode will be used to parse the formula.

    Throws

    [[ArgumentNullException]] 'value' is null or empty.

    Throws

    [[FormulaParseException]] 'value' is not a valid formula.

    Throws

    [[InvalidOperationException]] The region contains an array formula or data table which extends outside the region.

    See

    [[Formula]]

    Parameters

    • value: string

      The formula to parse and apply to the region.

    Returns void

  • Determines whether the specified value equals this [[WorksheetRegion]].

    Parameters

    • obj: any

      The value to test for equality.

    Returns boolean

  • Formats the region as a table and adds an associated [[WorksheetTable]] to the [[Worksheet.tables]] collection.

    When the table is created, the [[Workbook.defaultTableStyle]] will be applied to the value.

    When the table is created, the column names will be taken from the cells in the header row if 'tableHasHeaders' is True. If it is False, the column names will be generated and the cells for the header row will be inserted into the worksheet.

    The column names are unique within the owning WorksheetTable. If, when the table is created, there are two or more columns with the same name, the second and subsequent duplicate column names will have a number appended to make them unique. If any cells in the header row have a non-string value, their value will be changed to a string (the current display text of the cell). If any cells in the header row have no value, they will be given a generated column name.

    If the region partially contains any merged cell regions, they will be removed from the worksheet and the table region will be expanded to include all cells from the merged region.

    See

    • [[WorksheetTable.style]]
    • [[WorksheetTable]]
    • [[Worksheet.tables]]
    • [[WorksheetTableColumn.name]]
    • [[WorksheetTable.isHeaderRowVisible]]
    • [[WorksheetTableCollection.add]]

    Throws

    [[InvalidOperationException]] The region contains one or more cells from another [[WorksheetTable]].

    Throws

    [[InvalidOperationException]] The region contains one or more cells which have a multi-cell [[ArrayFormula]] applied.

    Throws

    [[InvalidOperationException]] The region contains one or more cells which are part of a [[WorksheetDataTable]].

    Parameters

    • tableHasHeaders: boolean

      A value which indicates whether the top row of the region contains the headers for the table.

    Returns WorksheetTable

  • Formats the region as a table and adds an associated [[WorksheetTable]] to the [[Worksheet.tables]] collection.

    When the table is created, the specified 'tableStyle' will be applied to the value.

    When the table is created, the column names will be taken from the cells in the header row if 'tableHasHeaders' is True. If it is False, the column names will be generated and the cells for the header row will be inserted into the worksheet.

    The column names are unique within the owning WorksheetTable. If, when the table is created, there are two or more columns with the same name, the second and subsequent duplicate column names will have a number appended to make them unique. If any cells in the header row have a non-string value, their value will be changed to a string (the current display text of the cell). If any cells in the header row have no value, they will be given a generated column name.

    If the region partially contains any merged cell regions, they will be removed from the worksheet and the table region will be expanded to include all cells from the merged region.

    See

    • [[WorksheetTable.style]]
    • [[WorksheetTable]]
    • [[Worksheet.tables]]
    • [[WorksheetTableColumn.name]]
    • [[Workbook.customTableStyles]]
    • [[Workbook.standardTableStyles]]
    • [[WorksheetTable.style]]
    • [[WorksheetTable.isHeaderRowVisible]]
    • [[WorksheetTableCollection.add]]

    Throws

    [[ArgumentException]] The specified 'tableStyle' does not exist in the [[Workbook.customTableStyles]] or [[Workbook.standardTableStyles]] collections.

    Throws

    [[InvalidOperationException]] The region contains one or more cells from another [[WorksheetTable]].

    Throws

    [[InvalidOperationException]] The region contains one or more cells which have a multi-cell [[ArrayFormula]] applied.

    Throws

    [[InvalidOperationException]] The region contains one or more cells which are part of a [[WorksheetDataTable]].

    Parameters

    • tableHasHeaders: boolean

      A value which indicates whether the top row of the region contains the headers for the table.

    • tableStyle: WorksheetTableStyle

      The [[WorksheetTableStyle]] to apply to the table or null to use the [[Workbook.defaultTableStyle]].

    Returns WorksheetTable

  • Gets the bounds of the region in twips (1/20th of a point).

    The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the region are resized, these bounds will no longer reflect the position of the region.

    Returns IgRect

  • Gets the bounds of the region in twips (1/20th of a point).

    The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the region are resized, these bounds will no longer reflect the position of the region.

    Parameters

    Returns IgRect

  • Returns IEnumerator$1<WorksheetCell>

  • Gtes the hash code for the [[WorksheetRegion]].

    Returns number

  • Returns Base

  • Gets the string representation of the range of cells in the region.

    Returns string

  • Gets the string representation of the range of cells in the region.

    Parameters

    • cellReferenceMode: CellReferenceMode

      The mode used to generate cell references.

    • includeWorksheetName: boolean

      The value indicating whether to include the worksheet name in the range address.

    Returns string

  • Gets the string representation of the range of cells in the region.

    Parameters

    • cellReferenceMode: CellReferenceMode

      The mode used to generate cell references.

    • includeWorksheetName: boolean

      The value indicating whether to include the worksheet name in the range address.

    • useRelativeColumn: boolean

      The value indicating whether to use a relative column address for the cells in the range.

    • useRelativeRow: boolean

      The value indicating whether to use a relative row address for the cells in the range.

    Returns string

  • 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