I want to write a simple Google function to copy columns A
to V
of a Google Sheets to the clipboard to use in another application.
I have the following code so far, but I need to get the contents to the clipboard, what mand would I use?
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Custom Menu')
.addItem('Copy Col A to V', 'copycolsAtoV')
.addToUi();
}
function copycolsAtoV() {
var ss = SpreadsheetApp.getActiveSheet();
ss.getRange('A:V')
}
I want to write a simple Google function to copy columns A
to V
of a Google Sheets to the clipboard to use in another application.
I have the following code so far, but I need to get the contents to the clipboard, what mand would I use?
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Custom Menu')
.addItem('Copy Col A to V', 'copycolsAtoV')
.addToUi();
}
function copycolsAtoV() {
var ss = SpreadsheetApp.getActiveSheet();
ss.getRange('A:V')
}
Share
Improve this question
edited Apr 20, 2015 at 6:48
livibetter
20.5k3 gold badges44 silver badges42 bronze badges
asked Apr 16, 2015 at 21:29
user3325770user3325770
611 gold badge1 silver badge3 bronze badges
3
- You cannot copy to the clipboard programmatically in JS due to security reasons. You may select the content to copy and prompt the user to do 'CTRL+C' – MarcoL Commented Apr 16, 2015 at 21:47
- What is the other application? – jmunsch Commented Apr 16, 2015 at 21:49
- Excel - I am using Google sheets to download web data and transferring this data to excell for processing - excell is not as efficient as Google getting data from websites and Google spreadsheet size limitations prevent me from using it as it is very slow - but getting the data across is a bit cumbersome so I want to streamline the process – user3325770 Commented Apr 17, 2015 at 18:51
1 Answer
Reset to default 0I actually achieved this by doing a copy-paste to a throw-away sheet once it is pasted it is left in the clipboard for use