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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -