Automatically Copy Data Between Google Sheets

前端 未结 1 1111
忘掉有多难
忘掉有多难 2021-01-16 22:53

I am looking for some help automating copying data between google sheets.

I have a sheet called \"Current Data\". This sheet has data in columns A-F(with headers). C

相关标签:
1条回答
  • 2021-01-16 23:15

    Try this:

    function copyPaste() {
      var ss=SpreadsheetApp.getActive();
      var srcsh=ss.getSheetByName('CurrentData');
      var dessh=ss.getSheetByName('HistoricalData');
      var srcrg=srcsh.getRange('A2:F100');
      var data=srcrg.getValues();
      var desrg=dessh.getRange(dessh.getLastRow() + 1,1,99,6);
      desrg.setValues(data);
    }
    
    0 讨论(0)
提交回复
热议问题