Copy data from one google sheet to another App Script without fail #ref error.
#Steps
- Open a google sheet.
- Goto tools>app script
- Add script id to add library section : 1IV7T2BPRuka-NIgvqh0ksSA_f9HrlPy_dmKZnoF9QlcIv6bx6D19CG5A
- Embed sheets & namerange location similarly to Sample excel or Set manually variables of sheet ids & their name ranges
- Run code.
Use function as per requirement.
- Data by Gsheet ID:
- Data by Gsheet name:
- Mail excel files write:
- Mail CSV file: function importSheet2Sheet(sourceID,sourceRange, destinationID, destinationRange,how ,filterColumnNum,filterBy,filterKey)
- Get data: function getdata(sourceID,sourceRange)
- Data by filtering: function filterbykey(data,filterColumnNum,filterBy,filterKey)
- Write data by Range: function exportData2Range(destinationID, destinationRange,data,how)
- destinationID - Sheet id of Destination file on where you want to copy.
- destinationRange - Destination data namedRange or range start reference ex.'Sheet1!A1:F17'.
- data - Source data to copy as arrey not blob.
- how - How you want to copy valid entries are "Replace" or "Append"
- sourceID - Sheet id of source source file from where you wan to copy.
- sourceRange - Source data namedRange or range.