Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

144
Views
google script copy data from sheet 1 to first empty row sheet 2

I want to make a script for my google spreadsheet that copy a range of data from sheet1 to the last empty row in Sheet2 ( column a). I don't know what is wrong, i get this error: error I'm a novice in programming.

7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

Copy Active Range to bottom of sheet 2

function copy() {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName('Sheet1')
  const rg = sh.getActiveRange();//you select the range before running the script
  const vs = rg.getValues();
  const tsh = ss.getSheetByName('Sheet2');
  tsh.getRange(tsh.getLastRow() + 1, 1,vs.length,vs[0].length).setValues(vs);
}
7 months 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 job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.