0
votes

I am trying to create macros on Google sheets, where I create a drawing, and link it to a script so that the cell content can be copied be pressing Ctrl + C. For some reason, my code isn't working, and I can't figure it out.

    function Launch1()
{
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("MacroBNS");
  ss.setActiveSheet(sheet).setActiveSelection("A3");
  function copyToClipboard(text) {
  window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
}
}

Any ideas on why it isn't working?

1

1 Answers

0
votes

you have function inside another function, this code doesn't work from line:

function copyToClipboard(text) {

Also code "window.prompt" gives error. You could use inputBox(prompt, buttons) instead. Look for more information here: https://developers.google.com/apps-script/reference/base/browser