ExcelScript.SpecialCellType enum
注解
示例
/**
* This script finds and highlights all the cells in the current worksheet that contain a formula.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the used range on the current sheet.
const currentSheet = workbook.getActiveWorksheet();
const usedRange = currentSheet.getUsedRange();
// Get the RangeAreas object for each cell with a formula.
const formulaCells = usedRange.getSpecialCells(ExcelScript.SpecialCellType.formulas);
// Add a light blue background to the cells containing formulas.
formulaCells.getFormat().getFill().setColor("#ADD8E6");
}
字段
blanks | 没有内容的单元格。 |
conditionalFormats | 具有条件格式的所有单元格。 |
constants | 含有常量的单元格。 |
dataValidations | 具有验证条件的单元格。 |
formulas | 含有公式的单元格。 |
sameConditionalFormat | 与区域中第一个单元格具有相同条件格式的单元格。 |
sameDataValidation | 与区域中第一个单元格具有相同数据验证条件的单元格。 |
visible | 可见的单元格。 |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈