-1

I am trying to automatically fill in the last row of a Google Sheet into a range from C2:K{{last_row}}. However, I am not sure how to proceed given my following code:

var dataSpreadsheetUrl = "https://docs.google.com/spreadsheets/sjhsak"; 
//make sure this includes the '
var ss = SpreadsheetApp.openByUrl(dataSpreadsheetUrl);
var deck = SlidesApp.getActivePresentation();
var sheet = ss.getSheetByName('Form_Responses');
var values = sheet.getRange('C2:K{{last_row}}').getValues();

How would I do this?

cesarteaser
  • 91
  • 1
  • 6

1 Answers1

0

I am not sure what is your goal, but you must be looking for this:

sheet.getRange(`C2:K${sheet.getLastRow()}`).getValues();

If you want to store values starting from the last row and first column you could do this:

sheet.getRange(sheet.getLastRow()+1,1,values.length,values[0].length).setValues(values);

References:

soMarios
  • 24,472
  • 8
  • 28
  • 43