ExcelScript.SearchCriteria interface
Representa los criterios de búsqueda que se van a usar.
Comentarios
Ejemplos
/**
* 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);
}
Propiedades
complete |
Especifica si la coincidencia debe ser completa o parcial. Una coincidencia completa coincide con todo el contenido de la celda. Una coincidencia parcial coincide con una subcadena dentro del contenido de la celda (por ejemplo, |
match |
Especifica si la coincidencia distingue mayúsculas de minúsculas. El valor predeterminado es |
search |
Especifica la dirección de la búsqueda El valor predeterminado es adelante. Consulte |
Detalles de las propiedades
completeMatch
Especifica si la coincidencia debe ser completa o parcial. Una coincidencia completa coincide con todo el contenido de la celda. Una coincidencia parcial coincide con una subcadena dentro del contenido de la celda (por ejemplo, cat
coincidencias parciales caterpillar
y scatter
). El valor predeterminado es false
(parcial).
completeMatch?: boolean;
Valor de propiedad
boolean
matchCase
Especifica si la coincidencia distingue mayúsculas de minúsculas. El valor predeterminado es false
(no distingue mayúsculas de minúsculas).
matchCase?: boolean;
Valor de propiedad
boolean
searchDirection
Especifica la dirección de la búsqueda El valor predeterminado es adelante. Consulte ExcelScript.SearchDirection
.
searchDirection?: SearchDirection;