looking for some solutions? You are welcome.

SOLVED: Copy Google Sheet Data to other Google Sheet below the Last Row

Bahadur Ali:

I am trying to copy one Google Sheet Data to Other Google Sheet after first available free row.

function CopyDataToNewFile() {
  var sss = SpreadsheetApp.openById('1vHc........'); // sss = source spreadsheet
  var ss = sss.getSheetByName('Database'); // ss = source sheet
  //Get full range of data
  var SRange = ss.getDataRange();
  //get A1 notation identifying the range
  var A1Range = SRange.getA1Notation();
  //get the data values in range
  var SData = SRange.getValues();

  var tss = SpreadsheetApp.openById('1ss......'); // tss = target spreadsheet
  var ts = tss.getSheetByName('CalDatabase'); // ts = target sheet

  ts.getRange(A1Range).setValues(SData);

}

Above quote works fine but always Copy into same Row, but I want it to copy the data into a new blank row available below.



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent