Guest User

Untitled

a guest
May 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. function cloneGoogleSheet('19tLZMYp5rX4tdPLaC2crLbpyj171qNW6uPh0ljGFvFo', '1gYBdi4i2V8uAMXuYkEFULrqCBS_ADSSaphgp7LiWTXU') {
  2.  
  3. // source doc with sheet ID
  4.  
  5. var sss = SpreadsheetApp.openById('19tLZMYp5rX4tdPLaC2crLbpyj171qNW6uPh0ljGFvFo');
  6.  
  7. // source sheet with actual sheet name
  8.  
  9. var ss = sss.getSheetByName('Customers');
  10.  
  11. // Get full range of data
  12.  
  13. var SRange = ss.getDataRange();
  14.  
  15. // get A1 notation identifying the range
  16.  
  17. var A1Range = SRange.getA1Notation();
  18.  
  19. // get the data values in range
  20.  
  21. var SData = SRange.getValues();
  22.  
  23. // target spreadsheet with sheet ID
  24.  
  25. var tss = SpreadsheetApp.openById('1gYBdi4i2V8uAMXuYkEFULrqCBS_ADSSaphgp7LiWTXU');
  26.  
  27. // target sheet with actual sheet name
  28.  
  29. var ts = tss.getSheetByName('Import');
  30.  
  31. // Clear the Google Sheet before copy
  32.  
  33. ts.clear({contentsOnly: true});
  34.  
  35. // set the target range to the values of the source data
  36.  
  37. ts.getRange(A1Range).setValues(SData);
  38.  
  39. }
  40.  
  41. function cloneGoogleSheet('19tLZMYp5rX4tdPLaC2crLbpyj171qNW6uPh0ljGFvFo', '1gYBdi4i2V8uAMXuYkEFULrqCBS_ADSSaphgp7LiWTXU') {
  42.  
  43. saying: "Missing formal parameter. (line 9, file "Code")"
Add Comment
Please, Sign In to add comment