Last active
March 13, 2019 06:50
-
-
Save franklinokech/f1e068b732bac161e27d3a85eba5c3e4 to your computer and use it in GitHub Desktop.
changes the name of the file and edited move to copy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A function to copy data from one SpreadSheet to another Spreadsheet | |
*/ | |
function CopyDataToNewFile() { | |
var sss = SpreadsheetApp.openById('1beVqbhcXrDTUNDiqbgO9Q-VgXau6ixOOc03BMTNFCqM');//Source spreadsheet ID | |
var ss = sss.getSheetByName('Data'); | |
var SRange = ss.getDataRange(); | |
var SData = SRange.getValues(); | |
var tss = SpreadsheetApp.openById('1aSXgCJfsEtSZfVQJcfZmwWod2xQbds5PHHTX5_O6rFU');//Target spreadsheet ID | |
var ts = tss.getSheetByName('DataCopy'); | |
ts.getRange(ts.getLastRow()+1,1,SData.length,SData[0].length).setValues(SData); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment