1
votes

I want to create auto date stamps in columns: A and J in several sheets ["Sheet 1", "Sheet 2", "Sheet 3", "Sheet 4", "Sheet 5"]. I'd like to have a date stamp in column A when column B is modified and a date stamp in column J when the column I is modified.

Here is the link: https://docs.google.com/spreadsheets/d/1-uBu1TqopQIykNyDJvknqEtW0rxh_c1V4TUeEqRvKiE/edit?usp=sharing

Thanks in advance!

1

1 Answers

1
votes
function onEdit(e){
  if(e.range.getRow() > 1){
    if(e.range.getColumn() == 2 || e.range.getColumn() == 9){
      insertDate(e);
    }
  }
}

function insertDate(e){
  var today = new Date();
  if(e.range.getColumn() == 2){
    e.range.offset(0,-1).setValue(today);
  }
  if(e.range.getColumn() == 9){
    e.range.offset(0,1).setValue(today);
  }
}