0

I saw this response (below) from a poster responding to a request for an automatic timestamp when a cell is filled out. I've added this script as a new project in Google Sheets. My question is, what is the formula to use in the cell where I want the timestamp??

Henrique G. Abreu said: "Just to help you get started ... "automatic timestamp when a cell is filled out ...

function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Sheet1" ) { //checks that we're on the correct sheet
var r = s.getActiveCell();
if( r.getColumn() == 4 ) { //checks the column
  var nextCell = r.offset(0, 1);
  if( nextCell.getValue() === '' ) //is empty?
    nextCell.setValue(new Date());
}
}
}

This code does what I understood from yours, which is: if something is edited on column D and column E is empty, add the current date to E."

  • 1
    Please add a tag for the language you are using. – ecg8 Nov 01 '18 at 17:28
  • [At least] the title needs clarifying what the scenario is. – cellepo Nov 01 '18 at 23:28
  • If the response in reference is on another stachexchange question, this question here should instead be a comment on that other question. If not on stackexchange, at least link here to wherever that reference is. – cellepo Nov 01 '18 at 23:30
  • Grammar in last 2 sentences is confusing: Are you directing those sentence to someone specific (emphasis "yours"), or are you describing your own understanding of the code in general? – cellepo Nov 01 '18 at 23:32

0 Answers0