Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Last Updated Column in Google Spreadsheets
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
var r = s.getActiveCell();
if( r.getColumn() != 2 && r.getRow() != 1 ) { //checks the column
var row = r.getRow();
var time = new Date();
var timezone = CalendarApp.getDefaultCalendar().getTimeZone();
time = Utilities.formatDate(time, timezone, "dd/MM/yyyy, hh:mm:ss");
SpreadsheetApp.getActiveSheet().getRange('B' + row.toString()).setValue(time);
};
};
@Stephen-Cronin

This comment has been minimized.

Copy link
Owner Author

Stephen-Cronin commented Sep 13, 2016

Uses code from http://webapps.stackexchange.com/questions/37408/auto-updating-column-in-google-spreadsheet-showing-last-modify-date

I added the timezone code found on that page, moved it to Australian date format and also modified it to ignore changes to the header row

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.