'How to get data from only the last row that has been added content to?
The code I have right now is getting information from the:
(2nd row,1st column, last row minus the title row, to the 80th column)
const data = currentSheet.getRange(2,1,currentSheet.getLastRow()-1,80).getDisplayValues();
But would like to get information only from the last row that has been added content to it.
How should that look like?
const data = currentSheet.getRange( ? ,1,currentSheet.getLastRow()-1,80).getDisplayValues();
thank you.
Solution 1:[1]
#Get last row data
function getlastrowdata() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName("Sheeet Name");
const data = sh.getDataRange().getValues();
Logger.log(sh.getRange(sh.getLastRow(),1,1,sh.getLastColumn())).getValues()[0];
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Cooper |
