Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.