-3

How do I edit var ws = "Jamie" to include. "Sheet1", "Sheet2" ... etc

function addTimestamp(e){
  //variables
  var startRow = 2;
  var targetColumn = 3;
  var ws = "Jamie"

  //get modified row and column
  var row = e.range.getRow(); 
  var col = e.range.getColumn();   

  if(col === targetColumn && row >= startRow && e.source.getActiveSheet ().getName() === ws){

     e.source.getActiveSheet().getRange(row,6).setValue(new Date());
     e.source.getActiveSheet().getRange(row,13).setValue(new Date());

  if(e.source.getActiveSheet().getRange(row,3).getValue()==""){
     e.source.getActiveSheet().getRange(row,6).setValue("");
     e.source.getActiveSheet().getRange(row,13).setValue("");

}
} // END function addTimestamp
}

https://docs.google.com/spreadsheets/d/1XH7LmVBRyMgzotkEHfMYmPuq6Zse3M0sg_UAlsJOANI/edit#gid=0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.