scripting - Googlescript How to loop with pasting data rows into different sheets? -
i have sheet 1 copy date have sheet 2 , 3 filter data copied in sheet 1 based on column 37 (two different criteria paste them automatically sheet 2 , 3 accordingly)
this script
function copypaste(event) { var ss = spreadsheetapp.getactivespreadsheet(); var s = spreadsheetapp.getactivesheet(); var r = spreadsheetapp.getactiverange(); if(s.getname() == "paste data here" && r.getcolumn() == 37 && r.getvalue() == "abo_pap") { var row = r.getrow(); var numcolumns = s.getlastcolumn(); var targetsheet = ss.getsheetbyname("abo_pap"); var target = targetsheet.getrange(targetsheet.getlastrow() + 1, 1); s.getrange(row, 1, 1, numcolumns).moveto(target); s.deleterow(row); } if(s.getname() == "paste data here" && r.getcolumn() == 37 && r.getvalue() == "abo_num_pap") { var row = r.getrow(); var numcolumns = s.getlastcolumn(); var targetsheet = ss.getsheetbyname("abo_num_pap"); var target = targetsheet.getrange(targetsheet.getlastrow() + 1, 1); s.getrange(row, 1, 1, numcolumns).moveto(target); s.deleterow(row); } }
it works fine except on edit , works 1 one need call action after pasting 10-15 lines right away want pass third criteria date parameter in fourth sheet.
Comments
Post a Comment