Last active
September 24, 2020 02:08
-
-
Save ttsukagoshi/97a3952e13f54150e4062bee593e975e to your computer and use it in GitHub Desktop.
Automatically enter the timestamp for the latest update on the current 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
const RECORDING_SHEET_NAME = 'SHEET_NAME'; // Sheet name to record the timestamp. | |
const RECORDING_CELL = {'row': 2, 'column': 2}; // Row and column number of the cell to record the timestamp. | |
/** | |
* Automatic timestamp for the latest update on this spreadsheet. | |
*/ | |
function onEdit() { | |
var now = new Date(); | |
var timestamp = now.toISOString(); | |
SpreadsheetApp.getActiveSpreadsheet() | |
.getSheetByName(RECORDING_SHEET_NAME) | |
.getRange(RECORDING_CELL.row, RECORDING_CELL.column) | |
.setValue(timestamp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment