ExcelScript.ClearApplyTo enum
注解
示例
/**
* This script removes any extra formatting that's been applied to a table.
* This leaves only the base table style effects.
* Any formatting outside of the table will be left as is.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the first table on the current worksheet.
let worksheet = workbook.getActiveWorksheet();
let table = worksheet.getTables()[0];
// Get the range used by the table.
let range = table.getRange();
// Clear all the formatting that is not applied by the table and the table style.
range.clear(ExcelScript.ClearApplyTo.formats);
}
字段
all | |
contents | 清除区域的内容。 |
formats | 清除区域的所有格式设置。 |
hyperlinks | 清除所有超链接,但保留所有内容和格式不变。 |
removeHyperlinks | 删除单元格的超链接和格式,但保留内容、条件格式和数据验证不变。 |