How to execute an existing macro (or any other kind of script) on a new Google Sheet with the least number of clicks/keystrokes?
Or even automatically when opening it?

Context: My bank sends me a new Google Sheet each day, and I need to execute the same few basic calculations inside it, taking me a minute each day. These operations can be macro'd easily, so I would love a way to execute the macro quickly.

  • Use Copy to... in the tab bar to copy the new sheet to your existing spreadsheet and run the existing macro there. Jun 12, 2023 at 15:51
  • @doubleunary: Great idea, could you please post it as an answer?
    – nic
    Jun 13, 2023 at 6:02
  • My comment does not answer the question "How to execute an existing script function on a new Google Sheet". It just mentions one solution to the underlying problem you have. These two things are not the same, and Stack Exchange is a question-answer wiki site rather than a problem-solution discussion forum. Jun 13, 2023 at 17:28

1 Answer 1


As a baseline, here is my current way of importing macros, it is unfortunately very time-consuming:

  1. Click Extensions then Apps Script.
  2. Wait for 10 seconds until the UI is fully loaded.
  3. CTRL-A.
  4. CTRL-C to paste the macro you prepared.
  5. CTRL-S to save.
  6. CTRL-W to close the Apps Script tab.
  7. Click Extensions then Macros then Import macro.
  8. Click Add function.
  9. Ckick X to close the dialog.
  10. Click Extensions then Macros then the imported macro.
  11. A Authorization Required dialog pops up, click Continue.
  12. A Choose an account dialog pops up, click your account.
  13. A Google hasn’t verified this app dialog pops up, click Advanced then Go to [...].
  14. A [...] wants to access your Google Account dialog pops up, scroll down to reveal the Allow button then click it.
  15. Click Extensions then Macros then the imported macro again, as the authorization cancels the first run.

It takes 18 clicks, 4 keystrokes, 1 scroll and a lot of waiting.

Faster solutions very welcome!

  • This answer should be instead an edit to your question, it is essentially your current research that you have found unacceptable.
    – Blindspots
    Jun 12, 2023 at 20:31
  • I would argue that it is a solution, albeit a time-consuming one. Once better solutions appear and get upvoted, they will be more visible than this one. :-)
    – nic
    Jun 13, 2023 at 6:10
  • You stated in your question that "current way I know to import the existing macro requires too many clicks/keystrokes for it to be time-efficient." and I assume that is a very long detailed description of the approach you find unacceptable but if you think it is an answer to the question posed by the person that indicated that it wasn't an acceptable answer to the question, who am I to argue. I'll let you two sort it out :-)
    – Blindspots
    Jun 13, 2023 at 6:45
  • 1
    Haha you are right, I am inconsistent, thanks for pointing this out. I guess I should frame the question as "what is the fastest way?" rather than judge what is acceptable or not. I will try to edit the question, looking forward to your feedback (and sorry for editing the question rather than getting it right the first time).
    – nic
    Jun 13, 2023 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.