UnionRange

UnionRange class

Represents union range.

Methods

NameDescription
applyStyle(style, flag)Applies formats for a whole range. Each cell in this range will contains a Style object. So this is a memory-consuming m
copy(range, options)Copying the range with paste special options.
getCellCount()Gets all cell count in the range.
getColumnCount()Gets the count of rows in the range. Only effects when it only contains one range.
getFirstColumn()Gets the index of the first column of the range. Only effects when it only contains one range.
getFirstRow()Gets the index of the first row of the range. Only effects when it only contains one range.
getHyperlinks()Gets all hyperlink in the range.
getName()Gets or sets the name of the range. Named range is supported. For example, range.Name = “Sheet1!MyRange”;
getRangeCount()Gets the count of the ranges.
getRanges()Gets all union ranges.
getRefersTo()Gets the range’s refers to.
getRowCount()Gets the count of rows in the range. Only effects when it only contains one range.
getValue()Gets and sets the values of the range.
hasRange()Indicates whether this has range.
intersect(range)Intersects another range. If the two union ranges are not intersected, returns null.
intersect(unionRange)Intersects another range. If the two union ranges are not intersected, returns null.
intersect(ranges)Intersects another range. If the two union ranges are not intersected, returns null.
iterator()Gets the enumerator for cells in this Range. When traversing elements by the returned Enumerator, the cells collection s
merge()Combines a range of cells into a single cell. Reference the merged cell via the address of the upper-left cell in the ra
putValue(stringValue, isConverted, setStyle)Puts a value into the range, if appropriate the value will be converted to other data type and cell’s number format will
setName()Gets or sets the name of the range. Named range is supported. For example, range.Name = “Sheet1!MyRange”;
setOutlineBorders(borderStyles, borderColors)Sets out line borders around a range of cells. Both the length of borderStyles and borderStyles must be 4. The order of
setOutlineBorders(borderStyle, borderColor)Sets the outline borders around a range of cells with same border style and color.
setStyle(style)Sets the style of the range.
setValue()Gets and sets the values of the range.
unMerge()Unmerges merged cells of this range.
union(range)Union another range.
union(unionRange)Union another range.
union(ranges)Union the ranges.

applyStyle(style, flag)

Applies formats for a whole range. Each cell in this range will contains a Style object. So this is a memory-consuming method. Please use it carefully.

ParameterTypeDescription
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

copy(range, options)

Copying the range with paste special options.

ParameterTypeDescription
rangeUnionRangeThe source range.
optionsPasteOptionsThe paste special options.

getCellCount()

Gets all cell count in the range.

getColumnCount()

Gets the count of rows in the range. Only effects when it only contains one range.

getFirstColumn()

Gets the index of the first column of the range. Only effects when it only contains one range.

getFirstRow()

Gets the index of the first row of the range. Only effects when it only contains one range.

Gets all hyperlink in the range.

getName()

Gets or sets the name of the range. Named range is supported. For example, range.Name = “Sheet1!MyRange”;

getRangeCount()

Gets the count of the ranges.

getRanges()

Gets all union ranges.

getRefersTo()

Gets the range’s refers to.

getRowCount()

Gets the count of rows in the range. Only effects when it only contains one range.

getValue()

Gets and sets the values of the range.

hasRange()

Indicates whether this has range.

intersect(range)

Intersects another range. If the two union ranges are not intersected, returns null.

ParameterTypeDescription
rangeStringThe range.

intersect(unionRange)

Intersects another range. If the two union ranges are not intersected, returns null.

ParameterTypeDescription
unionRangeUnionRangeThe range.

intersect(ranges)

Intersects another range. If the two union ranges are not intersected, returns null.

ParameterTypeDescription
rangesArray ofRangeThe range.

iterator()

Gets the enumerator for cells in this Range. When traversing elements by the returned Enumerator, the cells collection should not be modified(such as operations that will cause new Cell/Row be instantiated or existing Cell/Row be deleted). Otherwise the enumerator may not be able to traverse all cells correctly(some elements may be traversed repeatedly or skipped).@return {Iterator} The cells enumerator

merge()

Combines a range of cells into a single cell. Reference the merged cell via the address of the upper-left cell in the range.

putValue(stringValue, isConverted, setStyle)

Puts a value into the range, if appropriate the value will be converted to other data type and cell’s number format will be reset.

ParameterTypeDescription
stringValueStringInput value
isConvertedbooleanTrue: converted to other data type if appropriate.
setStylebooleanTrue: set the number format to cell’s style when converting to other data type

setName()

Gets or sets the name of the range. Named range is supported. For example, range.Name = “Sheet1!MyRange”;

setOutlineBorders(borderStyles, borderColors)

Sets out line borders around a range of cells. Both the length of borderStyles and borderStyles must be 4. The order of borderStyles and borderStyles must be top,bottom,left,right

ParameterTypeDescription
borderStylesArray of NumberBorder styles.
borderColorsArray ofColorBorder colors.

setOutlineBorders(borderStyle, borderColor)

Sets the outline borders around a range of cells with same border style and color.

ParameterTypeDescription
borderStyleNumberCellBorderType
borderColorColorBorder color.

setStyle(style)

Sets the style of the range.

ParameterTypeDescription
styleStyleThe Style object.

setValue()

Gets and sets the values of the range.

unMerge()

Unmerges merged cells of this range.

union(range)

Union another range.

ParameterTypeDescription
rangeStringThe range.

Returns: UnionRange — UnionRange

union(unionRange)

Union another range.

ParameterTypeDescription
unionRangeUnionRangeThe range.

Returns: UnionRange — UnionRange

union(ranges)

Union the ranges.

ParameterTypeDescription
rangesArray ofRangeThe ranges.

Returns: UnionRange — UnionRange