I have a reading log in a spreadsheet. Column 3 is the book name, 4 is the start page, and 5 is the end page. I want to make a script that could find the current book name in the reading log, then offset(0,2).getValue() to get the end page, and put it next to the active cell in column 3.This is what I try:
var s = e.source.getActiveSheet();var r = e.source.getActiveCell();if (r.getColumn() == "3" && r.getValue() != "") {e.range.offset(0,1).setValue(SpreadsheetApp.getActive().createTextFinder(r.getValue()).findPrevious().offset(0,2).getValue())}However, this script doesn't work. It doesn't fill in anything at all. Does the script really search for anything? Or the way I get value is incorrect?