I am running an Apps Script, and some other program or users continually add entries/rows on the first 5 columns. The next 3 columns are contingent upon the values of the first 5, using some formulae fixed on the first non-header row. (The formulae are not necessarily mathematical, more like text processing, so I can't really use the Google Sheet function ARRAYFORMULA
as much as I want to).
The way I want to do this is to get the latest rows (we call it lastRow
). For the range covered by columns F:H (6-8), except the header row, I want to get the first empty row or the last non-empty row, to determine the exact region/range I need to update with the formulae.
sh = spreadsheet.getActiveSheet();
let lastRow = sh.getLastRow();
let rangeOfInterest = sh.getRange(2, 6, lastRow, 3);
// how to get first empty row or last non-empty row of rangeOfInterest