ApiRange
Class representing a range.
Properties
| Name | Type | Description |
|---|---|---|
| Address | string | Returns the range address. |
| AlignHorizontal | 'left' | 'right' | 'center' | 'justify' | Sets the text horizontal alignment to the current cell range. |
| AlignVertical | 'center' | 'bottom' | 'top' | 'distributed' | 'justify' | Sets the text vertical alignment to the current cell range. |
| Areas | ApiAreas | Returns a collection of the areas. |
| Bold | boolean | Sets the bold property to the text characters from the current cell or cell range. |
| Cells | ApiRange | Returns a Range object that represents all the cells in the specified range or a specified cell. |
| CellsCount | number | Returns a number of cells in the current range. |
| Characters | ApiCharacters | Returns the ApiCharacters object that represents a range of characters within the object text. Use the ApiCharacters object to format characters within a text string. |
| Col | number | Returns the column number for the selected cell. |
| Cols | ApiRange | Returns the ApiRange object that represents the columns of the specified range. |
| ColumnWidth | number | Returns or sets the width of all the columns in the specified range measured in points. |
| Columns | ApiRange | Returns the ApiRange object that represents the columns of the specified range. |
| ColumnsCount | number | Returns a number of columns in the current range. |
| Comments | ApiComment | null | Returns the ApiComment collection that represents all the comments from the specified worksheet. |
| Count | number | Returns the rows or columns count. |
| CurrentRegion | ApiRange | Returns a range that represents the expanded range around the current range. |
| DefName | ApiName | Returns the ApiName object. |
| EntireColumn | ApiRange | Returns a Range object that represents the entire column(s) containing the specified range. |
| EntireRow | ApiRange | Returns a Range object that represents the entire row(s) containing the specified range. |
| FillColor | ApiColor | 'No Fill' | Returns or sets the background color of the current cell range. |
| FontColor | ApiColor | Sets the text color to the current cell range with the previously created color object. |
| FontName | string | Sets the specified font family as the font name for the current cell range. |
| FontSize | number | Sets the font size (measured in points) to the characters of the current cell range. |
| FormatConditions | ApiFormatConditions | Returns the collection of conditional formatting rules for the current range. |
| Formula | string | Returns a formula from the first cell of the specified range or sets it to this cell. |
| Height | number | Returns a value that represents the range height measured in points. |
| Hidden | boolean | Returns or sets the value hiding property. |
| Italic | boolean | Sets the italic property to the text characters in the current cell or cell range. |
| MergeArea | ApiRange | Returns the cell or cell range from the merge area. |
| NumberFormat | string | Sets a value that represents the format code for the object. |
| Orientation | Angle | Returns an angle to the current cell range. |
| PivotTable | ApiPivotTable | null | Returns the ApiPivotTable object that represents the pivot table report containing the upper-left corner of the specified range. |
| ReadingOrder | 'context' | 'ltr' | 'rtl' | Sets the direction (reading order) of the text in the current cell range. |
| Row | number | Returns the row number for the selected cell. |
| RowHeight | number | Returns or sets the height of the first row in the specified range measured in points. |
| Rows | ApiRange | Returns the ApiRange object that represents the rows of the specified range. |
| RowsCount | number | Returns a number of rows in the current range. |
| Strikeout | boolean | Sets a value that indicates whether the contents of the current cell or cell range are displayed struck through. |
| Text | string | Returns the text from the first cell of the specified range or sets it to this cell. |
| Underline | 'none' | 'single' | 'singleAccounting' | 'double' | 'doubleAccounting' | Sets the type of underline applied to the font. |
| Validation | ApiValidation | Returns the ApiValidation class instance associated with this range. If no validation instance exists yet, it will be created. |
| Value | string | Returns a value 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. |
| Width | number | Returns a value that represents the range width measured in points. |
| Worksheet | ApiWorksheet | Returns the ApiWorksheet object that represents the worksheet containing the specified range. |
| 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. |
Methods
The following table lists the available methods.
| Method | Returns | Description |
|---|---|---|
| AddComment | ApiComment | null | Adds a comment to the current range. |
| AutoFit | None | Changes the width of the columns or the height of the rows in the range to achieve the best fit. |
| Clear | boolean | Clears the current range. |
| ClearContents | None | Clears all contents from the current range. |
| ClearFormats | None | Clears all formatting from the current range. |
| ClearHyperlinks | None | Clears all hyperlinks from the current range. |
| Copy | None | Copies the range to the specified range or to the clipboard. |
| Cut | None | Cuts the range and save it to the clipboard or paste it to the specified range. |
| Delete | None | Deletes the Range object. |
| End | ApiRange | Returns a Range object that represents the end in the specified direction in the specified range. |
| FillDown | boolean | Copies the contents and formatting of the top row of the range into the remaining rows. |
| FillLeft | boolean | Copies the contents and formatting of the rightmost column of the range into the remaining columns. |
| FillRight | boolean | Copies the contents and formatting of the leftmost column of the range into the remaining columns. |
| FillUp | boolean | Copies the contents and formatting of the bottom row of the range into the remaining rows. |
| Find | ApiRange | null | Finds specific information in the current range. |
| FindNext | ApiRange | null | Continues a search that was begun with the ApiRange#Find method. Finds the next cell that matches those same conditions and returns the ApiRange object that represents that cell. |
| FindPrevious | ApiRange | null | Continues a search that was begun with the ApiRange#Find method. Finds the previous cell that matches those same conditions and returns the ApiRange object that represents that cell. |
| ForEach | boolean | Executes a provided function once for each cell. |
| GetAddress | string | null | Returns the range address. |
| GetAreas | ApiAreas | Returns a collection of the ranges. |
| GetCells | ApiRange | Returns a Range object that represents all the cells in the specified range or a specified cell. |
| GetCellsCount | number | Returns a number of cells in the current range. |
| GetCharacters | ApiCharacters | Returns the ApiCharacters object that represents a range of characters within the object text. |
| GetClassType | "range" | Returns a type of the ApiRange class. |
| GetCol | number | Returns a column number for the selected cell. |
| GetCols | ApiRange | null | Returns a Range object that represents the columns in the specified range. |
| GetColumnWidth | number | Returns the column width value. |
| GetColumnsCount | number | Returns a number of columns in the current range. |
| GetComment | ApiComment | null | Returns the ApiComment object of the current range. |
| GetCount | number | Returns the rows or columns count. |
| GetCurrentRegion | ApiRange | null | Returns a range that represents the expanded range around the current range. |
| GetDefName | ApiName | Returns the ApiName object of the current range. |
| GetEntireColumn | ApiRange | null | Returns a Range object that represents the entire column(s) containing the specified range. |
| GetEntireRow | ApiRange | null | Returns a Range object that represents the entire row(s) containing the specified range. |
| GetFillColor | ApiColor | 'No Fill' | Returns the background color for the current cell range. |
| GetFormatConditions | ApiFormatConditions | Returns the collection of conditional formatting rules for the current range. |
| GetFormula | string | string[][] | Returns a formula of the specified range. |
| GetFormulaArray | string | null | Returns an array formula from the current range. |
| GetHidden | boolean | Returns the value hiding property. |
| GetNumberFormat | string | null | Returns a value that represents the format code for the current range. |
| GetOrientation | Angle | Returns the current range angle. |
| GetPivotTable | ApiPivotTable | null | Returns the ApiPivotTable object that represents the pivot table report containing the upper-left corner of the specified range. |
| GetRange | ApiRange | null | Returns a Range object that represents a cell or a range of cells. |
| GetRow | number | Returns a row number for the selected cell. |
| GetRowHeight | pt | Returns the row height value. |
| GetRows | ApiRange | null | Returns a Range object that represents the rows in the specified range. |
| GetRowsCount | number | Returns a number of rows in the current range. |
| GetText | string | string[][] | Returns the text of the specified range. |
| GetValidation | ApiValidation | Returns the data validation object associated with this range. |
| GetValue | string | number | boolean | (string | number | boolean)[][] | Returns a value of the specified range. |
| GetValue2 | string | string[][] | Returns the Value2 property (value without format) of the specified range. |
| GetWorksheet | ApiWorksheet | Returns the Worksheet object that represents the worksheet containing the specified range. |
| GetWrapText | boolean | Returns the information about the wrapping cell style. |
| Insert | None | Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space. |
| Merge | boolean | Merges the selected cell range into a single cell or a cell row. |
| Offset | ApiRange | null | Returns a Range object offset from the current range. |
| Paste | None | Pastes the Range object to the specified range. |
| PasteSpecial | None | Pastes the Range object to the specified range using the special paste options. |
| Replace | boolean | Replaces specific information to another one in a range. |
| Resize | ApiRange | null | Resizes the current range by changing the number of rows and columns. |
| Select | boolean | Selects the current range. |
| SetAlignHorizontal | boolean | Sets the horizontal alignment of the text in the current cell range. |
| SetAlignVertical | boolean | Sets the vertical alignment of the text in the current cell range. |
| SetAutoFilter | None | Adds an AutoFilter to the current range. |
| SetBold | boolean | Sets the bold property to the text characters in the current cell or cell range. |
| SetBorders | boolean | Sets the border to the cell / cell range with the parameters specified. |
| SetColumnWidth | None | Sets the width of all the columns in the current range. |
| SetFillColor | boolean | Sets the background color to the current cell range with the previously created color object. |
| SetFontColor | boolean | Sets the text color to the current cell range with the previously created color object. |
| SetFontName | boolean | Sets the specified font family as the font name for the current cell range. |
| SetFontSize | boolean | Sets the font size to the characters of the current cell range. |
| SetFormula | boolean | Sets a formula or value to the current cell or cell range. |
| SetFormulaArray | boolean | Sets an array formula to the current range. |
| SetHidden | boolean | Sets the value hiding property. |
| SetItalic | boolean | Sets the italic property to the text characters in the current cell or cell range. |
| SetNumberFormat | boolean | Specifies whether a number in the cell should be treated like number, currency, date, time, etc. or just like text. |
| SetOffset | boolean | Sets the cell offset. |
| SetOrientation | None | Sets an angle to the current cell range. |
| SetReadingOrder | None | Sets the direction (reading order) of the text in the current cell range. |
| SetRowHeight | boolean | Sets the row height value. |
| SetSort | None | Sorts the cells in the given range by the parameters specified in the request. |
| SetStrikeout | boolean | Specifies that the contents of the cell / cell range are displayed with a single horizontal line through the center of the contents. |
| SetUnderline | boolean | Specifies that the contents of the current cell / cell range are displayed along with a line appearing directly below the character. |
| SetValue | boolean | Sets a value to the current cell or cell range. |
| SetWrap | boolean | Specifies whether the words in the cell must be wrapped to fit the cell size or not. |
| UnMerge | boolean | Splits the selected merged cell range into the single cells. |