ExcelScript.SpecialCellValueType enum
注解
示例
/**
* This script finds and bolds the text of cells containing strings (not numbers or formulas).
*/
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 only text.
const textCells = usedRange.getSpecialCells(
ExcelScript.SpecialCellType.constants,
ExcelScript.SpecialCellValueType.text);
// Bold the text of those cells.
textCells.getFormat().getFont().setBold(true);
}
字段
all | 具有错误、布尔值、数值或字符串值的单元格。 |
errors | 有错误的单元格。 |
errorsLogical | 具有错误或布尔值的单元格。 |
errorsLogicalNumber | 具有错误、布尔值或数值的单元格。 |
errorsLogicalText | 具有错误、布尔值或字符串值的单元格。 |
errorsNumbers | 具有错误或数值的单元格。 |
errorsNumberText | 具有错误、数字或字符串值的单元格。 |
errorsText | 具有错误或字符串值的单元格。 |
logical | 具有布尔值的单元格。 |
logicalNumbers | 具有布尔值或数值的单元格。 |
logicalNumbersText | 具有布尔值、数值或字符串值的单元格。 |
logicalText | 具有布尔值或字符串值的单元格。 |
numbers | 具有数值的单元格。 |
numbersText | 具有数值或字符串值的单元格。 |
text | 具有字符串值的单元格。 |