So I have the following function in app scripts that's is inserting today's date into a new column:
function createTodayDate() {
const ss1 = SpreadsheetApp.getActiveSpreadsheet();
const date = Utilities.formatDate(new Date(), "GMT+1", "dd/MM/yyyy")
ss1.getSheetByName('Sheet1').getRange('B:B').setValue(date)
}
However the insert is going all the going to the last row in the sheet no matter if it has data or not. So I wanted to know what to add the function mention above to get the code to do something like this:
testHeader | dataInserted |
---|---|
testA | 9/8/2022 |
TestB | 9/8/2022 |
Instead of inserting data all the way to the bottom that looks like this:
testHeader | dataInserted |
---|---|
testA | 9/8/2022 |
TestB | 9/8/2022 |
9/8/2022 | |
9/8/2022 | |
9/8/2022 |
So basically I want the function to run until the last row that has data on it like the first table.