0

I am looking for a way to create a function using script editing within google sheets that would allow me to insert a static timestamp into a cell based on multiple criteria. All I need is a custom function to simply retrieve the current date. I have absolutely no background in script editing and have been struggling to no avail. Can someone provide for me a simple script that would be able to be copied and pasted?

Thank you!!

Rubén
  • 34,714
  • 9
  • 70
  • 166

1 Answers1

0

Here is a script that will set a timestamp on the neighboring cell

function onEdit(event){ 
  var f = event.source.getActiveSheet();
  var r = event.source.getActiveRange();
  if ((r.getColumn() == 2) && (f.getName() == 'mySheet') && (r.getRow() > 2)){ 
    r.offset(0,-1).setValue(new Date());
  }
}
Mike Steelson
  • 14,650
  • 2
  • 5
  • 20