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

0

44
Views
google app scripts Find Value then copy entire row

I'm really new to google sheets app script. I need an script which finds a date in row 1, selects the entire row and copy and paste values only. This is because I have formulas in each column which will only work if row 1 matches =today().

7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

To get the range values and save into a variable (copy):

var book = SpreadsheetApp.openByUrl(url); //url=spread sheet url
var sheet = book.getSheetByName("sheet name");
var range = sheet.getRange(a, b, x, y).getValues(); 
//a=inicial row ,b=inicial column, x=last row, y=last column
// range will be a bidimensional array
// "A1" cell value will be: range[0][0]

To append in new cells (paste): //you have to iterate the array

sheet.appendRow([range]);
7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs