ApiRange
class ApiRange
Description
Class representing a range.
Instance Methods
- GetClassType
(): range
Returns a type of the ApiRange class.
- GetRow
(): number
Returns a row number for the selected cell.
- GetCol
(): number
Returns a column number for the selected cell.
- Clear
()
Clears the current range.
- GetRows
(nRow): ApiRange | "null"
Returns a Range object that represents the rows in the specified range.
- GetCols
(nCol): ApiRange | "null"
Returns a Range object that represents the columns in the specified range.
- End
(direction): ApiRange
Returns a Range object that represents the end in the specified direction in the specified range.
- GetCells
(row, col): ApiRange
Returns a Range object that represents all the cells in the specified range or a specified cell.
- SetOffset
(nRow, nCol)
Sets the cell offset.
- GetAddress
(RowAbs, ColAbs, RefStyle, External, RelativeTo): string | "null"
Returns the range address.
- GetCount
(): number
Returns the rows or columns count.
- GetValue
(): string | string[][]
Returns a value of the specified range.
- SetValue
(data): boolean
Sets a value to the current cell or cell range.
- GetFormula
(): string | string[][]
Returns a formula of the specified range.
- GetValue2
(): string | string[][]
Returns the Value2 property (value without format) of the specified range.
- GetText
(): string | string[][]
Returns the text of the specified range.
- SetFontColor
(oColor)
Sets the text color to the current cell range with the previously created color object.
- GetHidden
(): boolean
Returns the value hiding property.
- SetHidden
(isHidden)
Sets the value hiding property.
- GetColumnWidth
(): number
Returns the column width value.
- SetColumnWidth
(nWidth)
Sets the width of all the columns in the current range.
- GetRowHeight
(): pt
Returns the row height value.
- SetRowHeight
(nHeight)
Sets the row height value.
- SetFontSize
(nSize)
Sets the font size to the characters of the current cell range.
- SetFontName
(sName)
Sets the specified font family as the font name for the current cell range.
- SetAlignVertical
(sAligment): boolean
Sets the vertical alignment of the text in the current cell range.
- SetAlignHorizontal
(sAlignment): boolean
Sets the horizontal alignment of the text in the current cell range.
- SetBold
(isBold)
Sets the bold property to the text characters in the current cell or cell range.
- SetItalic
(isItalic)
Sets the italic property to the text characters in the current cell or cell range.
- SetUnderline
(undelineType)
Specifies that the contents of the current cell / cell range are displayed along with a line appearing directly below the character.
- SetStrikeout
(isStrikeout)
Specifies that the contents of the cell / cell range are displayed with a single horizontal line through the center of the contents.
- SetWrap
(isWrap)
Specifies whether the words in the cell must be wrapped to fit the cell size or not.
- GetWrapText
(): boolean
Returns the information about the wrapping cell style.
- SetFillColor
(oColor)
Sets the background color to the current cell range with the previously created color object.
- GetFillColor
(): ApiColor | No Fill
Returns the background color for the current cell range.
- GetNumberFormat
(): string | "null"
Returns a value that represents the format code for the current range.
- SetNumberFormat
(sFormat)
Specifies whether a number in the cell should be treated like number, currency, date, time, etc. or just like text.
- SetBorders
(bordersIndex, lineStyle, oColor)
Sets the border to the cell / cell range with the parameters specified.
- Merge
(isAcross)
Merges the selected cell range into a single cell or a cell row.
- UnMerge
()
Splits the selected merged cell range into the single cells.
- ForEach
(fCallback)
Executes a provided function once for each cell.
- AddComment
(sText, sAuthor): ApiComment | "null"
Adds a comment to the current range.
- GetWorksheet
(): ApiWorksheet
Returns the Worksheet object that represents the worksheet containing the specified range.
- GetDefName
(): ApiName
Returns the ApiName object of the current range.
- GetComment
(): ApiComment | "null"
Returns the ApiComment object of the current range.
- Select
()
Selects the current range.
- GetOrientation
(): Angle
Returns the current range angle.
- SetOrientation
(angle)
Sets an angle to the current cell range.
- SetSort
(key1, sSortOrder1, key2, sSortOrder2, key3, sSortOrder3, sHeader, sOrientation)
Sorts the cells in the given range by the parameters specified in the request.
- Delete
(shift)
Deletes the Range object.
- Insert
(shift)
Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space.
- AutoFit
(bRows, bCols)
Changes the width of the columns or the height of the rows in the range to achieve the best fit.
- GetAreas
(): ApiAreas
Returns a collection of the ranges.
- Copy
(destination)
Copies the range to the specified range or to the clipboard.
- Cut
(destination)
Cuts the range and save it to the clipboard or paste it to the specified range.
- Paste
(rangeFrom)
Pastes the Range object to the specified range.
- PasteSpecial
(sPasteType, sPasteSpecialOperation, bSkipBlanks, bTranspose)
Pastes the Range object to the specified range using the special paste options.
- GetPivotTable
(): ApiPivotTable | "null"
Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range.
- Find
(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase): ApiRange | "null"
Finds specific information in the current range.
- FindNext
(After): ApiRange | "null"
Continues a search that was begun with the {@link ApiRange#Find} method.
- FindPrevious
(Before): ApiRange | "null"
Continues a search that was begun with the {@link ApiRange#Find} method.
- Replace
(What, Replacement, LookAt, SearchOrder, SearchDirection, MatchCase, ReplaceAll)
Replaces specific information to another one in a range.
- GetCharacters
(Start, Length): ApiCharacters
Returns the ApiCharacters object that represents a range of characters within the object text.
Instance Properties
- Row
number
Returns the row number for the selected cell.
- Col
number
Returns the column number for the selected cell.
- Rows
ApiRange
Returns the ApiRange object that represents the rows of the specified range.
- Cols
ApiRange
Returns the ApiRange object that represents the columns of the specified range.
- Cells
ApiRange
Returns a Range object that represents all the cells in the specified range or a specified cell.
- Count
number
Returns the rows or columns count.
- Address
string
Returns the range address.
- Value
string
Returns a value from the first cell of the specified range or sets it to this cell.
- Formula
string
Returns a formula from the first cell of the specified range or sets it to this cell.
- Value2
string
Returns the value2 (value without format) from the first cell of the specified range or sets it to this cell.
- Text
string
Returns the text from the first cell of the specified range or sets it to this cell.
- FontColor
ApiColor
Sets the text color to the current cell range with the previously created color object.
- Hidden
boolean
Returns or sets the value hiding property.
- ColumnWidth
number
Returns or sets the width of all the columns in the specified range measured in points.
- Width
number
Returns a value that represents the range width measured in points.
- RowHeight
number
Returns or sets the height of the first row in the specified range measured in points.
- Height
number
Returns a value that represents the range height measured in points.
- FontSize
number
Sets the font size to the characters of the current cell range.
- FontName
string
Sets the specified font family as the font name for the current cell range.
- AlignVertical
center | bottom | top | distributed | justify
Sets the text vertical alignment to the current cell range.
- AlignHorizontal
left | right | center | justify
Sets the text horizontal alignment to the current cell range.
- Bold
boolean
Sets the bold property to the text characters from the current cell or cell range.
- Italic
boolean
Sets the italic property to the text characters in the current cell or cell range.
- Underline
none | single | singleAccounting | double | doubleAccounting
Sets the type of underline applied to the font.
- Strikeout
boolean
Sets a value that indicates whether the contents of the current cell or cell range are displayed struck through.
- WrapText
boolean
Returns the information about the wrapping cell style or specifies whether the words in the cell must be wrapped to fit the cell size or not.
- FillColor
ApiColor | No Fill
Returns or sets the background color of the current cell range.
- NumberFormat
string
Sets a value that represents the format code for the object.
- MergeArea
ApiRange
Returns the cell or cell range from the merge area.
- Worksheet
ApiWorksheet
Returns the ApiWorksheet object that represents the worksheet containing the specified range.
- DefName
ApiName
Returns the ApiName object.
- Comments
ApiComment | "null"
Returns the ApiComment collection that represents all the comments from the specified worksheet.
- Orientation
xlDownward | xlHorizontal | xlUpward | xlVertical
Sets an angle to the current cell range.
- Areas
ApiAreas
Returns a collection of the areas.
- Characters
ApiCharacters
Returns the ApiCharacters object that represents a range of characters within the object text.
- PivotTable
ApiPivotTable | "null"
Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range.