Excel.SearchCriteria interface
使用する検索条件を表します。
注釈
使用元
例
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
const table = sheet.tables.getItem("ExpensesTable");
const searchRange = table.getRange();
// Search for cells that exactly match "TODO", ignoring case, and starting from the top-left of the range and going forward.
const searchCriteria: Excel.SearchCriteria = {
completeMatch: true,
matchCase: false,
searchDirection: Excel.SearchDirection.forward
};
const foundRange = searchRange.findOrNullObject("TODO", searchCriteria);
foundRange.load("address");
await context.sync();
if (foundRange.isNullObject) {
console.log("Text not found");
} else {
console.log(foundRange.address);
}
});
プロパティ
| complete |
一致が完全であるか部分的である必要があるかどうかを指定します。 完全一致は、セルの内容全体と一致します。 部分一致は、セルのコンテンツ内の部分文字列と一致します (たとえば、 |
| match |
一致で大文字と小文字が区別されるかどうかを指定します。 既定値は |
| search |
検索の方向を指定します。 既定値は前方向です。
|
プロパティの詳細
completeMatch
一致が完全であるか部分的である必要があるかどうかを指定します。 完全一致は、セルの内容全体と一致します。 部分一致は、セルのコンテンツ内の部分文字列と一致します (たとえば、caterpillarとscatterに部分的に一致cat)。 既定値は false (部分) です。
completeMatch?: boolean;
プロパティ値
boolean
注釈
matchCase
一致で大文字と小文字が区別されるかどうかを指定します。 既定値は false です (大文字と小文字は区別されません)。
matchCase?: boolean;
プロパティ値
boolean
注釈
searchDirection
検索の方向を指定します。 既定値は前方向です。
Excel.SearchDirection
を参照してください。
searchDirection?: Excel.SearchDirection | "Forward" | "Backwards";
プロパティ値
Excel.SearchDirection | "Forward" | "Backwards"