gotoend

mail@pastecode.io avatar
unknown
javascript
2 years ago
384 B
3
Indexable
Never
function goToEnd() {
  let sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();  
  var range = sheet.getDataRange();
  var values = range.getValues();
  var row = 0;
  for (var row=0; row<values.length; row++) {
    if (!values[row].join("")) break;
  }
  let lastRow = row+1;
  let lastCell = sheet.getRange(lastRow, 1);
  sheet.setCurrentCell(lastCell);
}