Returns the size of all of the ranges this is the rows * columns.
Returns an iterator that allows you to iterate over the individual values within the range.
Optionaloptions: ICellRange.IteratorOptions<any>
Configuration options for the iterator, such as filtering or sorting.
An iterator that yields Scalar value, each representing a single cell within the range.
Add a listener to the range.
Optionaloptions: ListenerOptionsA callback to remove. IListener.Remove
ICellRange.addWatch across every area, as ONE expression authored at a shared origin.
An expression, or a formula, authored at the top-left of the bounding box of every area — which need not be a cell of any area.
Receives each area's results separately, with the area's index and the area.
Optionaloptions: WatchOptions
How each cell is evaluated; see ICellRange.WatchOptions.
A callback removing every area's watch.
This is the form a multi-area rule wants, and the reason it exists is the anchor. A
conditional format over E5:F6 E10:F11 stores ONE formula, authored at the sqref origin
E5 — so E10 must evaluate that formula FILLED to E10, an anchor no cell in the second
area carries. Over E7:F7 B11:C11 the origin is B7: the areas' order does not matter. Compiling each area against its own top-left instead makes area two read area
one's cells: E5>5 read from E10 means "is the cell five rows up greater than 5".
So the fill lives here, where the areas are known to belong to one rule, rather than on ICellRange.addWatch, which takes what it is given and refuses to guess. Callers pass no anchor and compute no offsets.
One watch per area — deliberately not pooled by expression. The callback therefore fires per area, and an edit touching two of them delivers twice.
Adjusts the column widths and rows heights to fit the content.
Optionaloptions: AutoFitOptionsThe current ICellRange.
Re-evaluates and formulas within the range.
OptionalfullRecalc: boolean
If true then all formulas will be recalculated.
Clear the range.
OptionalapplyTo: ICell.Content
The type of content to clear. Defaults to all@returns The currentICellRange`.
Optionaloptions: ITransaction.OperationOptionsCopies (or cuts) data and formatting from a specified source to the current range.
The source of the data and formatting to be copied or cut.
This can be either a range address, another range object, or an ISnapshot
created using the getSnapshot method.
Optionaloptions: ICellRange.CopyOptionsA promise that resolve to an ICellRange or 'null' when the copy has completed.
Delete the cells within the range and shifts the remaining cells to fill the gap.
Optionaloptions: Axis | DeleteOptions
The axis or The direction in which to shift existing cells. Defaults to the axis where the range's dimension is smaller (e.g., shifts down if the range is wider than it is tall). See ICellRange.getDefaultShiftAxis for details on the default behavior. See ITransaction.OperationOptions
The current ICellRange.
Perform a set of operations as a batch.
The callback return type.
Function to perform the operations.
Optionaloptions: string | ITransaction.OperationOptions
Description of the operation or additional options. This will be used for tracking undo/redo and history.
The result of the callback.
Returns an iterator that allows you to iterate over the individual cells within the ranges,
yielding pairs of IteratorContext and a Value.
Optionaloptions: ICellRange.IteratorOptions<ICellRange.Address>
Configuration options for the iterator, such as filtering or sorting.
An iterator that yields [ICell.IteratorContext, Value] tuples for each value within the range.
If the ranges overlap this will return the same value multiple times. If each cell should only be visited once, use ICellRanges.getFlattened to remove overlaps.
Returns an iterator of ICells that match the results.
The text to search for or FindOptions
The address of these ranges. See ICellRange.getAddress.
Optionalr1c1: booleanWhether the address is sheet-QUALIFIED is a property of where the ranges came from, not an option — and it is the caller's signal for what these ranges mean:
sheet.getRanges(...), sheet.getSelectedRanges(), a table's range) — BARE
($B$2:$D$5). One implicit sheet; there is nothing to qualify against.workbook.getRanges(...), a formula's getReferences()) — always
QUALIFIED (Sheet1!$B$2:$D$5), each range by its own scope, so a multi-sheet set round-trips.Both keep $ fixability. Callers must NOT re-derive either form (prefixing a sheet name onto an
already-qualified address doubles it; rebuilding from numeric coords drops the $ flags) — take
the string as given, and choose the SOURCE that carries the scoping you want.
Returns the count for all columns in the ranges. This will ensure columns that are included in multiples ranges are not double counted.
Returns the header range for the columns.
Optionaloptions: ICellHeaderRange.GetRangeOptionsICellHeaderRange for the columns.
The RangeCoords.
Returns the total number of contiguous ranges in this collection.
Returns per-feature cell counts for the range.
Optionalfeatures: ICellRange.Feature | readonly ICellRange.Feature[]
The features to count. Defaults to all public features — counting is the discovery call.
getCounts answers "how much of each feature is here"; getStats answers "what
are the values like". Feature occupancy vs value analysis — they do not overlap.
0 — the shape is stable and self-describing, never null.getCounts([Fill, Border]) is two numbers,
not the count of their refined intersection — the refined count is getRegions.getRegions returns or cost as much as computing it.Default IRange.Axis that will be used to shift the range.
Returns the ranges whose formulas reference these ranges.
OptionalentireSet: boolean
If true the search is recursive downstream through the full calculation
chain to find the total impact of a value change; if false (the default) only the
immediate consumers are returned.
ICellRanges.getDirectDependents / ICellRanges.getDependents for the single-cell equivalents.
Returns a range that includes the columns for the entire sheet.
For example, if the range is A1:B2, this method will return A:B.
OptionalshiftRows: boolean
If true this will also shift the columns by the width of the range. default false.
Optionaloptions: ICellRange.GetRangeOptionsICellRange at the repositioned range.
Returns a range that includes the rows for the entire sheet.
For example, if the range is A1:B2, this method will return 1:2.
OptionalshiftColumns: boolean
If true this will also shift the rows by the height of the range. default false.
Optionaloptions: ICellRange.GetRangeOptionsICellRange at the repositioned range.
Returns a ranges with coordinates adjusted to be fixed (absolute) or flexible (relative).
Returns a set of ranges with overlaps removed and attempts to merge adjacent ranges into larger ranges.
Optionaloptions: GetFlattenOptionsReturn an array of coords for all merges.
An array of 'IRange.Coords` that contain merges.
Returns the ranges referenced by the formulas within these ranges.
OptionalentireSet: boolean
If true the search is recursive upstream through the full calculation
chain to find all contributing ranges; if false (the default) only the direct inputs
are returned.
ICellRanges.getDirectPrecedents / ICellRanges.getPrecedents for the single-cell equivalents.
Returns the count for all rows in the ranges. This will ensure rows that are included in multiples ranges are not double counted.
Returns the header range for the rows.
Optionaloptions: ICellHeaderRange.GetRangeOptionsICellHeaderRange for the rows.
Returns the Sheet.
Returns a ICellRange.ISnapshot for all of the ranges.
Optionaloptions: ICellRange.CopyOptionsReturns the statistics for the ranges.
Optionaloptions: GetStatsOptions
Iterator options the stats are created with — most usefully
{ onError: 'ignore' } so aggregate reads degrade instead of faulting on error values.
Overlapping areas are flattened first — each cell contributes once, agreeing with getCounts.
Returns a range that excludes any hidden rows or columns.
Optionaloptions: GetVisibleOptions
Optional parameters that can adjust how visibility is determined (e.g., by ignoring specific visibility rules).
An ICellRanges object that contains the visible portions of the range, excluding any hidden rows or columns.
ICellRanges object with a single range and a length of 1.null.Insert a new, empty range within the sheet and shifts existing cells to accommodate it.
Optionaloptions: Axis | InsertOptions
The axis or The direction in which to shift existing cells. Defaults to the axis where the range's dimension is smaller (e.g., shifts down if the range is wider than it is tall). See ICellRange.getDefaultShiftAxis for details on the default behavior. See ITransaction.OperationOptions
The current ICellRange.
Inserts the contents of the source into the sheet, shifting existing cells to make space.
The source of the data and formatting to insert.
This can be either a range address, another range object, or an ISnapshot
created using the getSnapshot method.
Optionaloptions: InsertFromOptionsA promise that resolve to an ICellRange or 'null' when the copy has completed.
Returns true if there is any content within the range.
Optionalfeatures: ICellRange.Feature | readonly ICellRange.Feature[]
Restrict the check to specific features. Defaults to any content.
'boolean' indicating if there is content.
Returns true if every range is entire columns, such as B:D.
isEntireColumnsAny asks the same of any one range.
Returns true if any range is entire columns, such as B:D.
isEntireColumns asks the same of every range.
Returns true if every range is entire rows, such as 2:4.
isEntireRowsAny asks the same of any one range.
Returns true if any range is entire rows, such as 2:4.
isEntireRows asks the same of every range.
Returns true if the given address represents the same range as the current range.
The address to compare against.
Optionaloptions: ICellRange.GetRangeOptions
Options for getting the range from the address.
Returns true if the range is invalid. This can occur if a range is removed or created with invalid coordinates.
Returns true if any of the ranges are invalid.
Returns a flag indicating if any of the ranges are overlapping.
To get a range with no overlaps ICellRanges.getFlattened can be used.
Indicates if the range is readonly only.
Not an indicator of if the range is protected but rather if the range is being used in a way that doesn't support write operations. (e.g. the range is being provided as a listener source ICellRange.Event or the range belongs to a historical snapshot.)
Returns true if only a single cell is included in the ranges.
Merges all cells within the selection ranges.
Optionaloptions: AxisSelection | MergeOptionsThe current ICellRange.
Selects the current range.
Optionaloptions: ICellRange.SelectOptionsAn async ICellRange.
Broadcasts a single value into every cell of every range in the collection.
Optionaloptions: SetValuesOptionsThis is Excel's Ctrl+Enter fill: the same scalar is written to all selected cells — across every
discontiguous range — as a single ICellRanges.doBatch operation (one undo step). A formula
string (e.g. "=A1+1") is coerced and its relative references adjust per cell, exactly as
ICellRange.setValue does within one range.
Only the scalar-broadcast form exists (no setValues): a 2D shape has no coherent meaning spread
across discontiguous ranges of differing sizes.
Returns the address as a string.
Unmerge all cells within the selection ranges.
Optionaloptions: ITransaction.OperationOptionsThe current ICellRange.
An
ICellRangesis a collection of ICellRanges.Useful when working with a discontinuous set of ranges.