I have this very small issue and I was hoping someone could help me solve it. This is the code.
function textFinder() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var range = sheet.getActiveRange();
var textFinder = range.createTextFinder('=');
var firstOccurrence = textFinder.findNext();
var numOccurrencesReplaced = firstOccurrence.replaceWith("=");
}
When the code runs I get
Error
TypeError: Cannot read property 'replaceWith' of null
textFinder @ findReplace.gs:11
I am trying to find the = in a function that is in A1 B1 D1