ExcelScript.NamedItemType enum
注解
示例
/**
* This script looks for every named range with "Review" in the name
* and marks the range with a yellow fill.
*/
function main(workbook: ExcelScript.Workbook) {
// Look at every named item in the workbook.
workbook.getNames().forEach((namedItem) => {
// Find names containing "Review".
if (namedItem.getName().includes("Review")) {
// Only change the fill color if the named item is a range (not a formula).
let itemType: ExcelScript.NamedItemType = namedItem.getType();
if (itemType === ExcelScript.NamedItemType.range) {
// Set the range's fill color to yellow.
namedItem.getRange().getFormat().getFill().setColor("yellow");
}
}
});
}
字段
array | |
boolean | |
double | |
error | |
integer | |
range | |
string |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈