excol
Options
All
  • Public
  • Public/Protected
  • All
Menu

Range class.

Hierarchy

  • Range

Index

Constructors

constructor

  • new Range(row?: number, rowHeight: number, column?: number, columnWidth: number, parent: Sheet | null, cells?: Array<Array<Cell>>): Range
  • Constructor

    Parameters

    • Default value row: number = 0

      Column coordinate

    • rowHeight: number

      Number of rows

    • Default value column: number = 0
    • columnWidth: number

      Number of columns

    • parent: Sheet | null
    • Optional cells: Array<Array<Cell>>

      Cell values

    Returns Range

Accessors

cellValue

cellValue:

cells

cells:

columnWidth

columnWidth:

rowHeight

rowHeight:

values

values:

Methods

breakApart

clear

  • Clears the range of contents, formats, and data-validation rules.

    Clears the range of contents, format, data-validation rules, and/or comments, as specified with the given advanced options. By default all data will be cleared.

    Parameters

    Returns Range

contains

  • contains(other: Range): boolean

getA1Notation

  • getA1Notation(): string

getBackground

  • getBackground(): string
  • Returns the background color of the top-left cell in the range.

    Returns string

getBackgrounds

  • getBackgrounds(): string[]

getCell

  • getCell(row: number, column: number): Range

getColumn

  • getColumn(): number

getDataValidation

  • Returns the data-validation rule for the top-left cell in the range. If data validation has not been set on the cell, this method returns null.

    Returns DataValidation

getDataValidations

  • Returns the data-validation rule for the top-left cell in the range. If data validation has not been set on the cell, this method returns null. TODO: return null...

    Returns DataValidation[]

getDisplayValue

  • getDisplayValue(): string
  • Returns the displayed value of the top-left cell in the range. The value will be of type String.

    Returns string

    display value

getDisplayValues

  • getDisplayValues(): string[]
  • Returns the rectangular grid of values for this range.

    Returns string[]

    a two-dimensional array of values

getFontColor

  • getFontColor(): string
  • Returns the font color of the cell in the top-left corner of the range.

    Returns string

getFontColors

  • getFontColors(): string[]
  • Returns the font colors of the cells in the range

    Returns string[]

    font colors

getFontFamilies

  • getFontFamilies(): string[]
  • Returns the font families of the cells in the range.

    Returns string[]

    font families

getFontFamily

  • getFontFamily(): string
  • Returns the font family of the cell in the top-left corner of the range.

    Returns string

getFontLine

  • getFontLine(): string
  • Gets the line style of the cell in the top-left corner of the range.

    Returns string

getFontLines

  • getFontLines(): string[]
  • Gets the line style of the cells in the range.

    Returns string[]

    font lines

getFontSize

  • getFontSize(): number
  • Returns the font size in point size of the cell in the top-left corner of the range.

    Returns number

getFontSizes

  • getFontSizes(): number[]
  • Returns the font sizes of the cells in the range.

    Returns number[]

    font sizes

getFontStyle

  • getFontStyle(): string
  • Returns the font style ('italic' or 'normal') of the cell in the top-left corner of the range.

    Returns string

getFontStyles

  • getFontStyles(): string[]
  • Returns the font styles of the cells in the range.

    Returns string[]

    font styles

getFontWeight

  • getFontWeight(): string
  • Returns the font weight (normal/bold) of the cell in the top-left corner of the range.

    Returns string

getFontWeights

  • getFontWeights(): string[]
  • Returns the font weights of the cells in the range.

    Returns string[]

    font weights

getFormula

  • getFormula(): string
  • Returns the formula (A1 notation) for the top-left cell of the range, or an empty string if the cell is empty or doesn't contain a formula.

    Returns string

getFormulaR1C1

  • getFormulaR1C1(): string
  • Returns the formula (R1C1 notation) for a given cell, or null if none.

    Returns string

getFormulas

  • getFormulas(): string[]
  • Returns the formulas (A1 notation) for the cells in the range. Entries in the 2D array will be an empty string for cells with no formula.

    Returns string[]

    formulas

getFormulasR1C1

  • getFormulasR1C1(): string[]
  • Returns the formulas (R1C1 notation) for the cells in the range.

    Returns string[]

    formulas

getHeight

  • getHeight(): number

getHorizontalAlignment

  • getHorizontalAlignment(): string
  • Returns the horizontal alignment of the text (left/center/right) of the cell in the top-left corner of the range.

    Returns string

getHorizontalAlignments

  • getHorizontalAlignments(): string[]
  • Returns the horizontal alignments of the cells in the range.

    Returns string[]

    font weights

getLastColumn

  • getLastColumn(): number

getLastRow

  • getLastRow(): number

getMergedRanges

  • getMergedRanges(): Range[]
  • Returns an array of Range objects representing merged cells that either are fully within the current range, or contain at least one cell in the current range."

    Returns Range[]

getNote

  • getNote(): string

getNotes

  • getNotes(): string[]
  • Returns the notes associated with the cells in the range.

    Returns string[]

    notes

getNumColumns

  • getNumColumns(): number

getNumRows

  • getNumRows(): number

getNumberFormat

  • getNumberFormat(): string
  • Get the number or date formatting of the top-left cell of the given range.

    Returns string

getNumberFormats

  • getNumberFormats(): string[]
  • Returns the number or date formats for the cells in the range.

    Returns string[]

getRow

  • getRow(): number

getRowIndex

  • getRowIndex(): number

getVerticalAlignment

  • getVerticalAlignment(): string
  • Returns the vertical alignment (top/middle/bottom) of the cell in the top-left corner of the range.

    Returns string

getVerticalAlignments

  • getVerticalAlignments(): string[]
  • Returns the vertical alignments of the cells in the range.

    Returns string[]

    alignments

getWidth

  • getWidth(): number
  • Returns the width of the range in columns.

    Returns number

    the number of columns in the range

insertColumnAfter

  • insertColumnAfter(afterPosition: number, howMany?: undefined | number): void
  • Inserts a column after the given column position.

    Parameters

    • afterPosition: number
    • Optional howMany: undefined | number

    Returns void

insertColumnBefore

  • insertColumnBefore(afterPosition: number, howMany?: undefined | number): void
  • Inserts a number of columns after the given column position.

    Parameters

    • afterPosition: number
    • Optional howMany: undefined | number

    Returns void

insertRowAfter

  • insertRowAfter(afterPosition: number, howMany?: undefined | number): void
  • Inserts a row after the given column position.

    Parameters

    • afterPosition: number
    • Optional howMany: undefined | number

    Returns void

insertRowBefore

  • insertRowBefore(afterPosition: number, howMany?: undefined | number): void
  • Inserts a number of rows after the given column position.

    Parameters

    • afterPosition: number
    • Optional howMany: undefined | number

    Returns void

merge

  • merge(): void

mergeAcross

  • mergeAcross(vertically?: undefined | true | false): void
  • Merge the cells in the range across the columns of the range.

    Parameters

    • Optional vertically: undefined | true | false

    Returns void

mergeVertically

  • mergeVertically(): void

moveTo

  • moveTo(target: Range): void
  • Cut and paste (both format and values) from this range to the target range.

    Parameters

    Returns void

offset

  • offset(rowOffset: number, columnOffset: number): void

overlap

  • overlap(other: Range): boolean

setBackground

  • setBackground(color: string): void
  • Sets the background color of all cells in the range in CSS notation (like '#ffffff' or 'white').

    Parameters

    • color: string

    Returns void

setBackgrounds

  • setBackgrounds(colors: string[]): void
  • Sets a rectangular lib of background colors (must match dimensions of this range). The colors are in CSS notation (like '#ffffff' or 'white').

    Parameters

    • colors: string[]

    Returns void

setDataValidation

setDataValidations

setFontColor

  • setFontColor(color: string): void
  • Sets the font color in CSS notation (like '#ffffff' or 'white').

    Parameters

    • color: string

    Returns void

setFontColors

  • setFontColors(colors: string[]): void
  • Sets a rectangular lib of font colors (must match dimensions of this range). The colors are in CSS notation (like '#ffffff' or 'white').

    Parameters

    • colors: string[]

    Returns void

setFontFamilies

  • setFontFamilies(fontFamilies: string[]): void
  • Sets a rectangular lib of font families (must match dimensions of this range). Examples of font families are "Arial" or "Helvetica".

    Parameters

    • fontFamilies: string[]

    Returns void

setFontFamily

  • setFontFamily(fontFamily: string): void
  • Sets the font family, such as "Arial" or "Helvetica".

    Parameters

    • fontFamily: string

    Returns void

setFontLine

  • setFontLine(fontLine: string): void
  • Sets the font line style of the given range ('underline', 'line-through', or 'none').

    Parameters

    • fontLine: string

    Returns void

setFontLines

  • setFontLines(fontLines: string[]): void
  • Sets a rectangular lib of line styles (must match dimensions of this range).

    Parameters

    • fontLines: string[]

    Returns void

setFontSize

  • setFontSize(fontSize: number): void
  • Sets the font size, with the size being the point size to use.

    Parameters

    • fontSize: number

    Returns void

setFontSizes

  • setFontSizes(fontSizes: Array<number>[]): void
  • Sets a rectangular lib of font sizes (must match dimensions of this range). The sizes are in points.

    Parameters

    • fontSizes: Array<number>[]

    Returns void

setFontStyle

  • setFontStyle(fontStyle: string): void
  • Set the font style for the given range ('italic' or 'normal').

    Parameters

    • fontStyle: string

    Returns void

setFontStyles

  • setFontStyles(fontStyles: string[]): void
  • Sets a rectangular lib of font styles (must match dimensions of this range).

    Parameters

    • fontStyles: string[]

    Returns void

setFontWeight

  • setFontWeight(fontWeight: string): void
  • Set the font weight for the given range (normal/bold).

    Parameters

    • fontWeight: string

    Returns void

setFontWeights

  • setFontWeights(fontWeights: string[]): void
  • Sets a rectangular lib of font weights (must match dimensions of this range). An example of a font weight is "bold".

    Parameters

    • fontWeights: string[]

    Returns void

setFormula

  • setFormula(formula: string): void
  • Updates the formula for this range.

    Parameters

    • formula: string

    Returns void

setFormulaR1C1

  • setFormulaR1C1(formula: string): void
  • Updates the formula for this range.

    Parameters

    • formula: string

    Returns void

setFormulas

  • setFormulas(formulas: string[]): void
  • Sets a rectangular lib of formulas (must match dimensions of this range)

    Parameters

    • formulas: string[]

    Returns void

setFormulasR1C1

  • setFormulasR1C1(formulas: string[]): void
  • Sets a rectangular lib of formulas (must match dimensions of this range)

    Parameters

    • formulas: string[]

    Returns void

setHorizontalAlignment

  • setHorizontalAlignment(horizontalAlignment: string): void
  • Set the horizontal (left to right) alignment for the given range (left/center/right).

    Parameters

    • horizontalAlignment: string

    Returns void

setHorizontalAlignments

  • setHorizontalAlignments(horizontalAlignments: string[]): void
  • Sets a rectangular lib of horizontal alignments.

    Parameters

    • horizontalAlignments: string[]

    Returns void

setNote

  • setNote(note: string): void

setNotes

  • setNotes(notes: string[]): void
  • Sets a rectangular lib of notes (must match dimensions of this range).

    Parameters

    • notes: string[]

    Returns void

setNumberFormat

  • setNumberFormat(numberFormat: string): void
  • Sets the number or date format to the given formatting string.

    Parameters

    • numberFormat: string

    Returns void

setNumberFormats

  • setNumberFormats(numberFormats: string[]): void
  • Sets a rectangular lib of number or date formats (must match dimensions of this range).

    Parameters

    • numberFormats: string[]

    Returns void

setValue

  • Sets the value of the range. The value can be numeric, string, boolean or date. If it begins with '=' it is interpreted as a formula.

    TODO: formula

    Parameters

    Returns void

setValues

  • setValues(values: Array<CellValue>[]): void
  • Sets a rectangular lib of values (must match dimensions of this range).

    Parameters

    Returns void

setVerticalAlignment

  • setVerticalAlignment(verticalAlignment: string): void
  • Set the vertical (left to right) alignment for the given range (left/center/right).

    Parameters

    • verticalAlignment: string

    Returns void

setVerticalAlignments

  • setVerticalAlignments(verticalAlignments: string[]): void
  • Sets a rectangular lib of vertical alignments.

    Parameters

    • verticalAlignments: string[]

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc