Created
January 30, 2025 08:53
-
-
Save hhkaos/9ed22518bc76aa0ae4ff564d92976106 to your computer and use it in GitHub Desktop.
Automatically update the last update date of a row in a Google Spreadsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onEdit(edit) { | |
var row = edit.range.getRow() | |
var timestampTimeZone = "GMT+1" | |
var timestampFormat = "dd/MM/yyyy" | |
if( row >=2 ){ | |
var timestamp = Utilities.formatDate( | |
new Date(), | |
timestampTimeZone, | |
timestampFormat) | |
SpreadsheetApp | |
.getActiveSpreadsheet() | |
.getRange('Comunidades!D'+row) // Change to the cell you want to update | |
.setValue(timestamp) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment