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

セルのハイパーリンクと書式設定を削除しますが、コンテンツ、条件付き書式、およびデータ検証はそのまま残します。