Skip to main content

Find and Replace

APIDescriptionExample
Range.FindFunction that finds specific data in the specified range and returns the corresponding range objectlet range = instance.Application.ActiveSheet.Range("A1:B2");

let found = range.Find("Something");
Range.FindNextFunction that finds the next specific data in the specified range and returns the corresponding range object
Note: Can be used after calling Range.Find function
let range = instance.Application.ActiveSheet.Range("A1:B2");
let found = range.Find("Something");

while (found != null) {
found = range.FindNext(found);
}
Range.FindPreviousFunction that finds the previous specific data in the specified range and returns the corresponding range object
Note: Can be used after calling Range.Find function
let range = instance.Application.ActiveSheet.Range("A1:B2");
let found = range.Find("Something");

while (found != null) {
found = range.FindPrevious(found);
}
Range.ReplaceFunction that finds specific data in the specified range and replaces it with other datalet range = instance.Application.ActiveSheet.Range("A1:B2");

range.Replace({
What: "Something",
Replacement: "Else"
});

Data Processing , Built-in Function Libraries , Autocomplete , Pivot Table Creation and Editing , Data Validation , Filter and Sort