ExcelScript.SearchCriteria interface

使用する検索条件を表します。

注釈

/**
 * This script searches for the next instance of the text "TK" on the current worksheet.
 * It then selects that cell and removes "TK" and all formatting from the cell.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the used range on the current worksheet.
  let range = workbook.getActiveWorksheet().getUsedRange();

  // Get the next cell that contains "TK".
  let tkCell = range.find("TK", {
    completeMatch: true, /* Don't match if the cell text only contains "TK" as part of another string. */
    matchCase: false,
    searchDirection: ExcelScript.SearchDirection.forward /* Start at the beginning of the range and go to later columns and rows. */
  });

  // Set focus on the found cell.
  tkCell.select();

  // Remove the "TK" text value from the cell, as well as any formatting that may have been added.
  tkCell.clear(ExcelScript.ClearApplyTo.all);
}

プロパティ

completeMatch

一致が完全であるか部分的である必要があるかどうかを指定します。 完全一致は、セルの内容全体と一致します。 部分一致は、セルの内容内の部分文字列と一致します (部分 cat 一致 caterpillarscatterなど)。 既定値は (部分) です false

matchCase

一致で大文字と小文字が区別されるかどうかを指定します。 既定値は false (大文字と小文字は区別されません)。

searchDirection

検索の方向を指定します。 既定値は前方向です。 ExcelScript.SearchDirectionを参照してください。

プロパティの詳細

completeMatch

一致が完全であるか部分的である必要があるかどうかを指定します。 完全一致は、セルの内容全体と一致します。 部分一致は、セルの内容内の部分文字列と一致します (部分 cat 一致 caterpillarscatterなど)。 既定値は (部分) です false

completeMatch?: boolean;

プロパティ値

boolean

matchCase

一致で大文字と小文字が区別されるかどうかを指定します。 既定値は false (大文字と小文字は区別されません)。

matchCase?: boolean;

プロパティ値

boolean

searchDirection

検索の方向を指定します。 既定値は前方向です。 ExcelScript.SearchDirectionを参照してください。

searchDirection?: SearchDirection;

プロパティ値