Skip to content

Instantly share code, notes, and snippets.

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);

This comment has been minimized.

Copy link
Owner Author

Stephen-Cronin commented Sep 13, 2016

Uses code from

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.