5

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 command 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')
}
livibetter
  • 19,832
  • 3
  • 42
  • 42
user3325770
  • 51
  • 1
  • 1
  • 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 Apr 16 '15 at 21:47
  • What is the other application? – jmunsch Apr 16 '15 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 Apr 17 '15 at 18:51

1 Answers1

0

I 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

apollosoftware.org
  • 12,161
  • 4
  • 48
  • 69
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 15 '22 at 13:12