获取包含指定区域的最小 range 对象。例如,“B2:C5”和“D10:E15”的 GetBoundingRect 为“B2:E16”。Gets the smallest range object that encompasses the given ranges. For example, the GetBoundingRect of "B2:C5" and "D10:E15" is "B2:E16".
根据行和列编号获取包含单个单元格的 range 对象。单元格可以位于父区域外部,只要其保持在工作表网格内即可。返回的单元格位于相对于区域左上角的单元格的位置。Gets the range object containing the single cell based on row and column numbers. The cell can be outside the bounds of its parent range, so long as it's stays within the worksheet grid. The returned cell is located relative to the top left cell of the range.
获取表示与指定区域偏移的区域的对象。返回的区域的尺寸将与该区域匹配。如果强制使生成的区域位于工作表网格的边界之外,则会引发异常。Gets an object which represents a range that's offset from the specified range. The dimension of the returned range will match this range. If the resulting range is forced outside the bounds of the worksheet grid, an exception will be thrown.
将单个单元格或一系列单元格插入到工作表中取代此区域,并移动其他单元格以留出空间。在现在空白的空间返回新的 Range 对象。Inserts a cell or a range of cells into the worksheet in place of this range, and shifts the other cells to make space. Returns a new Range object at the now blank space.
获取与当前范围对象类似的范围对象,但其右下角可通过一定数量的行和列进行展开(或合拢)。Gets a range object similar to the current range object, but with its bottom-right corner expanded (or contracted) by some number of rows and columns.
获取筛选的范围中的可见范围。Get the range visible from a filtered range.
属性Properties
属性Property
类型Type
说明Description
addressaddress
stringstring
表示 A1 样式的区域引用。地址值将包含工作表引用(如 Sheet1!A1:B4)。只读。Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. Sheet1!A1:B4). Read-only.
addressLocaladdressLocal
stringstring
以用户语言表示对指定区域的区域引用。只读。Represents range reference for the specified range in the language of the user. Read-only.
cellCountcellCount
intint
区域中的单元格数目。只读。Number of cells in the range. Read-only.
columnCountcolumnCount
intint
表示区域中的列总数。只读。Represents the total number of columns in the range. Read-only.
columnHiddencolumnHidden
booleanboolean
表示当前区域中的所有列是否隐藏。Represents if all columns of the current range are hidden.
columnIndexcolumnIndex
intint
表示区域中第一个单元格的列编号。从零开始编制索引。只读。Represents the column number of the first cell in the range. Zero-indexed. Read-only.
formulasformulas
JsonJson
表示采用 A1 表示法的公式。Represents the formula in A1-style notation.
formulasLocalformulasLocal
JsonJson
表示采用 A1 样式表示法的公式,使用用户的语言和数字格式区域设置。例如,英语中的公式 "=SUM(A1, 1.5)" 在德语中将变为 "=SUMME(A1; 1,5)"。Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German.
formulasR1C1formulasR1C1
JsonJson
表示采用 R1C1 样式表示法的公式。Represents the formula in R1C1-style notation.
hiddenhidden
booleanboolean
表示当前区域中的所有单元格是否隐藏。只读。Represents if all cells of the current range are hidden. Read-only.
numberFormatnumberFormat
JsonJson
表示 Excel 中指定单元格的数字格式代码。Represents Excel's number format code for the given cell.
rowCountrowCount
intint
返回区域中的总行数。只读。Returns the total number of rows in the range. Read-only.
rowHiddenrowHidden
booleanboolean
表示当前区域中的所有行是否隐藏。Represents if all rows of the current range are hidden.
rowIndexrowIndex
intint
返回区域中第一个单元格的行编号。从零开始编制索引。只读。Returns the row number of the first cell in the range. Zero-indexed. Read-only.
texttext
JsonJson
指定区域的文本值。文本值与单元格宽度无关。在 Excel UI 中替代 # 符号不会影响 API 返回的文本值。只读。Text values of the specified range. The Text value will not depend on the cell width. The # sign substitution that happens in Excel UI will not affect the text value returned by the API. Read-only.
valueTypesvalueTypes
JsonJson
表示每个单元格的数据类型。Represents the type of data of each cell.可取值包括:Unknown、Empty、String、Integer、Double、Boolean、Error。The possible values are: Unknown, Empty, String, Integer, Double, Boolean, Error.只读。Read-only.
valuesvalues
JsonJson
表示指定区域的原始值。返回的数据类型可能是字符串、数字或布尔值。包含一个将返回错误字符串的错误的单元格。Represents the raw values of the specified range. The data returned could be of type string, number, or a boolean. Cell that contain an error will return the error string.
返回一个格式对象,其中封装了区域的字体、填充、边框、对齐方式和其他属性。只读。Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties. Read-only.