Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cloneGoogleSheet('19tLZMYp5rX4tdPLaC2crLbpyj171qNW6uPh0ljGFvFo', '1gYBdi4i2V8uAMXuYkEFULrqCBS_ADSSaphgp7LiWTXU') {
- // source doc with sheet ID
- var sss = SpreadsheetApp.openById('19tLZMYp5rX4tdPLaC2crLbpyj171qNW6uPh0ljGFvFo');
- // source sheet with actual sheet name
- var ss = sss.getSheetByName('Customers');
- // 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();
- // target spreadsheet with sheet ID
- var tss = SpreadsheetApp.openById('1gYBdi4i2V8uAMXuYkEFULrqCBS_ADSSaphgp7LiWTXU');
- // target sheet with actual sheet name
- var ts = tss.getSheetByName('Import');
- // Clear the Google Sheet before copy
- ts.clear({contentsOnly: true});
- // set the target range to the values of the source data
- ts.getRange(A1Range).setValues(SData);
- }
- function cloneGoogleSheet('19tLZMYp5rX4tdPLaC2crLbpyj171qNW6uPh0ljGFvFo', '1gYBdi4i2V8uAMXuYkEFULrqCBS_ADSSaphgp7LiWTXU') {
- saying: "Missing formal parameter. (line 9, file "Code")"
Add Comment
Please, Sign In to add comment