Script do Google Apps Obtenha a última linha
// This example assumes there is a sheet named "first"
let ss = SpreadsheetApp.getActiveSpreadsheet();
let first = ss.getSheetByName("first");
// "first" sheet has a total row count of 10
// data exists only up to row 5
// rows 6 to 10 are blank rows
// getMaxRows()
// Returns the current number of rows in the sheet, regardless of content.
console.log(first.getMaxRows()); // 10
// getLastRow()
// Returns the position of the last row that has content.
console.log(first.getLastRow()); // 5
Web Surfer