Stay organized with collections Save and categorize content based on your preferences.
TextFinderFind or replace text within a range, sheet or spreadsheet. Can also specify search options.
Detailed documentationfindAll()
Returns all cells matching the search criteria.
ReturnRange[]
— All the matching cells.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
findNext()
Returns the next cell matching the search criteria.
ReturnRange
— The next matching cell, or null
if there are no previous matches.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
findPrevious()
Returns the previous cell matching the search criteria.
ReturnRange
— The previous matching cell, or null
if there are no previous matches.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
getCurrentMatch()
Returns the current cell matching the search criteria.
ReturnRange
— The current matching cell, or null
if there are no further matches.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
ignoreDiacritics(ignoreDiacritics)
If true
, configures the search to ignore diacritics while matching; otherwise the search matches diacritics. A diacritic is a sign, such as an accent or cedilla, which when written above or below a letter indicates a difference in pronunciation from the same letter when unmarked or differently marked.
ignoreDiacritics
Boolean
Whether the search considers diacritics. Return
TextFinder
— This text finder, for chaining.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
matchCase(matchCase)
If true
, configures the search to match the search text's case exactly, otherwise the search defaults to case-insensitive matching.
matchCase
Boolean
Whether the matching is case-sensitive. Return
TextFinder
— This text finder, for chaining.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
matchEntireCell(matchEntireCell)
If true
, configures the search to match the entire contents of a cell; otherwise, the search defaults to partial matching.
matchEntireCell
Boolean
Whether the entire cell is matched. Return
TextFinder
— This text finder, for chaining.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
matchFormulaText(matchFormulaText)
If true
, configures the search to return matches that appear within formula text; otherwise cells with formulas are considered based on their displayed value.
matchFormulaText
Boolean
Whether the search examines formula text. Return
TextFinder
— This text finder, for chaining.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
replaceAllWith(replaceText)
Replaces all matches with the specified text. Returns the number of occurrences replaced, which may be different from the number of matched cells.
Parameters Name Type DescriptionreplaceText
String
The text that replaces the text in the matched cells. Return
Integer
— The number of occurrences replaced.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
replaceWith(replaceText)
Replaces the search text in the currently matched cell with the specified text and returns the number of occurrences replaced.
Parameters Name Type DescriptionreplaceText
String
The text that replaces the content in the currently matched cell. Return
Integer
— The number of occurrences replaced.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
startFrom(startRange)
Configures the search to start searching immediately after the specified cell range.
Parameters Name Type DescriptionstartRange
Range
The cell range after which the search should start. Return
TextFinder
— This text finder, for chaining.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
useRegularExpression(useRegEx)
If true
, configures the search to interpret the search string as a regular expression; otherwise the search interprets the search string as normal text. For more details on how to use regular expressions, refer to the Find and replace support page.
useRegEx
Boolean
Whether to interpret the search string as a regular expression. Return
TextFinder
— This text finder, for chaining.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["TextFinder enables you to find and replace text within a spreadsheet, sheet, or range, with options for refining the search."],["It provides methods to find all matches, the next match, the previous match, or the current match, and allows for replacing matches with specified text."],["You can configure the search to consider case sensitivity, diacritics, entire cell matching, formula text inclusion, and regular expressions."],["All methods require authorization with specific scopes for accessing and modifying spreadsheets."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4