Skip to main content

SearchData

Properties to make search.

Type​

Object

Properties​

NameTypeDescription
AfterApiRangeThe cell after which you want the search to begin. If this argument is not specified, the search starts after the cell in the upper-left corner of the range.
LookAtXlLookAtSpecifies whether the whole search text or any part of the search text is matched.
LookInXlFindLookInSearch data type (formulas or values).
MatchCasebooleanCase sensitive or not. The default value is "false".
SearchDirectionXlSearchDirectionRange search direction - next match or previous match.
SearchOrderXlSearchOrderRange search order - by rows or by columns.
Whatstring | RegExp | undefinedThe data to search for, or a regular expression to match the cell text. When a RegExp is passed, the MatchCase and Wildcards parameters are ignored (control case sensitivity with the "i" flag instead).
WildcardsbooleanSpecifies whether to interpret the search text as a wildcard pattern: "" matches any character sequence, "?" matches any single character, use "~" / "~?" to find the literal "*" / "?" characters. The default value is "false".

Example​

Find text in a range by specifying the search data.

// How do I search for text using search data?

// Find a text from a range specifying data.

let searchRange = range.Find({
What: "200",
After: oWorksheet.GetRange("B1"),
LookIn: "xlValues",
LookAt: "xlWhole",
SearchOrder: "xlByColumns",
SearchDirection: "xlNext",
MatchCase: true
});
let wildcardRange = range.Find({
What: "2?0",
LookIn: "xlValues",
LookAt: "xlWhole",
Wildcards: true
});
let regExpRange = range.Find({
What: /\d{3}/,
LookIn: "xlValues",
LookAt: "xlPart"
});