Explanation:
If you want to set the timestamp in the active sheet s
then:
s.getRange(row,21).setValue(new Date());
or if you want in the target sheet targetSheet
then:
targetSheet.getRange(targetSheet.getLastRow(),21).setValue(new Date());
Solution:
function onEdit(event){
var ss = event.source;
var s = ss.getActiveSheet();
var r = event.range;
if(s.getName() == "Review" && r.getColumn() == 20 && r.getValue() == true) {
var row = r.getRow();
var numColumns = s.getLastColumn();
var targetSheet = ss.getSheetByName("Reviewed");
var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
s.getRange(row, 1, 1, numColumns).moveTo(target);
s.deleteRow(row);
s.getRange(row,21).setValue(new Date());
//targetSheet.getRange(targetSheet.getLastRow(),21).setValue(new Date());
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…