ExcelScript.WorkbookRangeAreas interface
表示多个工作表中一个或多个矩形区域的集合。
注解
示例
/**
* This script finds the direct precedents of the active cell.
* It changes the font and color of those precedent cells.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the active cell.
const selected = workbook.getActiveCell();
// Get the cells that are direct precedents of the current cell.
const precedents : ExcelScript.WorkbookRangeAreas = selected.getDirectPrecedents();
// Set the font to bold and the fill color to orange for all the precedent cells.
precedents.getRanges().forEach(range => {
range.getFormat().getFill().setColor("orange");
range.getFormat().getFont().setBold(true);
});
}
方法
get |
返回 A1 样式的地址数组。 地址值包含每个矩形单元格块的工作表名称, (例如“Sheet1!A1:B4,Sheet1!D1:D4“) 。 只读。 |
get |
返回 |
get |
|
get |
返回在 对象中 |
方法详细信息
getAddresses()
返回 A1 样式的地址数组。 地址值包含每个矩形单元格块的工作表名称, (例如“Sheet1!A1:B4,Sheet1!D1:D4“) 。 只读。
getAddresses(): string[];
返回
string[]
getAreas()
返回 RangeAreasCollection
对象。
RangeAreas
集合中的每个表示一个工作表中的一个或多个矩形区域。
getAreas(): RangeAreas[];
返回
getRangeAreasBySheet(key)
RangeAreas
根据集合中的工作表名称或 ID 返回 对象。 如果工作表不存在,则此方法返回 undefined
。
getRangeAreasBySheet(key: string): RangeAreas;
参数
- key
-
string
工作表的名称或 ID。