ExcelScript.SpecialCellType enum
Remarks
Examples
/**
* 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");
}
Fields
| blanks | Cells with no content. |
| conditionalFormats | All cells with conditional formats. |
| constants | Cells containing constants. |
| dataValidations | Cells with validation criteria. |
| formulas | Cells containing formulas. |
| sameConditionalFormat | Cells with the same conditional format as the first cell in the range. |
| sameDataValidation | Cells with the same data validation criteria as the first cell in the range. |
| visible | Cells that are visible. |