New answers tagged

0

then try e.range.offset(0, 7) function onEdit(e) { if ([3,4].indexOf(e.range.columnStart) != -1) { e.range.offset(0, 7).setValue(new Date()); } } to have dates only in one column try like this: function onEdit(e) { var s = SpreadsheetApp.getActiveSheet(); if( s.getName() == "Sheet1" ) { var r = s.getActiveCell(); if( r.getColumn() == 3 ) { var ...


0

Simple and installable triggers for open, edit and change events are triggered only when a user using the Google Sheets UI do the corresponding action. Reference https://developers.google.com/apps-script/guides/triggers Related How to add a date to a cell next to an cell with an imported value How to trigger a script in Google sheets when a value changes ...


0

Google Apps Script hasn't any trigger that is triggered by formula results changes, so you have to rethink how to get the result what you are looking for from a broader perspective. Maybe instead of looking for a formula change you should think about what makes the formula to be recalculated and which of those recalculations are relevant. By the way, ...


0

tanguay, I have just tested this =IF(A2<>"",NOW(),""). If A2 has a value then it enters the timestamp. If A2 is empty then the timestamp is not entered in the timestamp column.


0

try like this: function onEdit(e) { var s = SpreadsheetApp.getActiveSheet(); if( s.getName() == "Sheet3" ) { var r = s.getActiveCell(); if( r.getColumn() == 13 ) { var nextCell = r.offset(0, 9); var newDate = Utilities.formatDate(new Date(), "GMT+8", "MM/dd/yyyy hh:mm:ss"); nextCell.setValue(newDate); } if( r.getColumn() == 14 ) { var nextCell ...


0

SpreadsheetApp methods are slow so in order to speed-up our script we should minimize the use of them specially whenever it's possible avoid the use of these methods inside of loops. One thing to try is to get/set all the values with a single calle rather than making multiple calls to the SpreadsheetApp methods by usins getValues() instead of getValue() and ...


Top 50 recent answers are included