function - Google script onEdit in all pasted cells -
i have been using oedit function set actual date in column s when add new carton inventory (ctn, in column f).
it works when enter references manually when paste few references cartons @ once, script works on first edited row.
how manage execute script pasted rows?
please find following 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()); }
something perhaps?
function oneditxx(e) { var sheet = e.source.getactivesheet(); if (sheet.getname() !== 'sortie centrale vers auber'|| e.range.getcolumn() != 6) { return; } for(var i=0;i<e.range.getnumrows();i++) { var offset=e.range.getrow() + i; sheet.getrange('s'+ offset).setvalue(new date()); } }
Comments
Post a Comment