MCPcopy Create free account
hub / github.com/analyticswithadam/App_Script / copyFromOther

Function copyFromOther

GettingandSettingData.js:38–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38function copyFromOther(){
39 const id = "1eVS5x6R70XPbqMfBPfyzktdg2AeVTrPMnkfj1gXTHS4";
40 const s = SpreadsheetApp.openById(id);
41 const sheet = s.getSheets()[0];
42 const lastColumn = sheet.getLastColumn();
43 const lastRow = sheet.getLastRow();
44 const range = sheet.getRange(1, 1, lastRow, lastColumn); // Define Full Range with Last Row and Last Column
45 const data = range.getValues(); // Get all values
46 Logger.log(data);
47 const ss = SpreadsheetApp.getActiveSpreadsheet();
48 const newSheet = ss.insertSheet();
49 const newRange = newSheet.getRange(1,1,range.getNumRows(),range.getNumColumns());
50 newRange.setValues(data);
51}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected