I have been using an oEdit function to set the actual date in the column S when I add a new carton to my inventory (ctn, in column F).
It works perfectly when I enter the references manually but when I paste few references cartons at once, the script only works on the first edited row.
How do I manage execute the script for all the pasted rows?
Please find following the script:
function onEdit(ctn) {
var sheet = ctn.source.getActiveSheet();
var added_ctn = ctn.range;
var date_add = sheet.getRange("S" + added_ctn.getRow());
if (sheet.getName() !== 'SORTIE CENTRALE VERS AUBER'
|| added_ctn.columnStart != 6)
{return}
date_add.setValue(new Date());
}