Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function copyMultipleSpreadsheet() {
- var sss = SpreadsheetApp.openById('1FZg6pawRGvxwcH-wQRuw2xM5X5UDT-uf6v4Bq5BqaOQ'); // sss = source spreadsheet
- var ss = sss.getSheetByName('Sheet1'); // 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('1hQyOtVSXOMlBJKUeVRneVOYEoBWS599CljpsfP6N2_4'); // tss = target spreadsheet
- var ts = tss.getSheetByName('Sheet1'); // ts = target sheet
- //set the target range to the values of the source data
- ts.getRange(A1Range).setValues(SData);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement