Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
having trouble with a simple copy and paste function in google scripts

i'm trying to call a function from the menu bar to copy a set of values in google sheets to an "archive" tab. The error i'm getting is "Exception: The parameters (SpreadsheetApp.Range) don't match the method signature for SpreadsheetApp.Range.setValues." here is the code:

function archiveCompleted () {
 var spreadsheet = SpreadsheetApp.getActive();
 var copyFrom = spreadsheet.getSheetByName("completed autofill");
 var copyDest = spreadsheet.getSheetByName("Completed Orders");
 var sourceRange = copyFrom.getRange(1,1,copyFrom.getLastRow(),copyFrom.getLastColumn());
 var destRange = copyDest.getRange(copyDest.getLastRow() + 1,1,copyFrom.getLastRow(),copyFrom.getLastColumn()); 
 //1,1,copyFrom.getLastColumn());
 sourceRange.copyValuesToRange(destRange);
 spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Copy From Feildpine'),true);

}

thanks for any help!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I thought that about your error message of Exception: The parameters (SpreadsheetApp.Range) don't match the method signature for SpreadsheetApp.Range.setValues., unfortunately, I cannot find setValues in your showing script. So I'm worried that you miscopied your current script.

But, when I saw your script, I thought that sourceRange.copyValuesToRange(destRange); is required to be modified. Because the arguments of copyValuesToRange are gridId, column, columnEnd, row, rowEnd or sheet, column, columnEnd, row, rowEnd. Ref1, Ref2

So, in this modification, I would like to propose modifying the line as follows.

From:

sourceRange.copyValuesToRange(destRange);

To:

sourceRange.copyTo(destRange, {contentsOnly: true});

Reference:

  • copyTo(destination, options)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!