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

202
Views
get cells in range and paste as values Apps script

I have a range A2:Z5000 that i am trying to paste as values in the same exact range (turn formulas into fixed values)

In range A2 i have a ImportData formula fetching data from a csv file.

My script goes like:

var sheet = SpreadsheetApp.getActive().getSheetByName('MYSQLimport');
sheet.getRange("A2:Z5000").copyTo(sheet.getRange("A2:Z5000"), {contentsOnly:true});

but it erases the content instead of setting it as values...

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

0

Description

copyTo copies the contents being values and/or formulas you need to gettValues()/setValues().

Script

var values = sheet.getRange("A2:Z5000").getValues();
sheet.getRange("A2:Z5000").setValues(values);
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!