Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pierandrea/a02a02021adc4b5071b1 to your computer and use it in GitHub Desktop.
Save pierandrea/a02a02021adc4b5071b1 to your computer and use it in GitHub Desktop.
function ImportDataRange() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("toWorksheetName");
var ssraw = SpreadsheetApp.openById("fromSheetID");
var sheetraw = ssraw.getSheetByName("fromWorksheetName");
var range = sheetraw.getRange("rangeFrom");
var data = range.getValues();
sheet.getRange("rangeTO").setValues(data)
}
Copy the code above.
In the destination Sheet, open the Scrip Editor and paste the code.
Change the following parameters:
line 3 - Destination worskeet name;
line 4 - Source form ID;
line 5 - Source worksheet name;
line 6 - Source data range;
line 8 - Destination data range.
Save and run script.
Check that the data are correctly copied across the source and destination sheets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment