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

Function copySelectionToSheet

GettingandSettingData.js:10–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8}
9
10function copySelectionToSheet(){
11 const ss = SpreadsheetApp.getActiveSpreadsheet();
12 const sheet = ss.getActiveSheet();
13 const range = sheet.getActiveRange();
14 const data = range.getValues();
15 const newSheet = ss.insertSheet();
16 const newRange = newSheet.getRange(1,1,range.getNumRows(),range.getNumColumns());
17 newRange.setValues(data);
18}
19
20function copyToSheet(){
21 const ss = SpreadsheetApp.getActiveSpreadsheet();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected