0

I have written a little bit of Apps Script code for a spreadsheet that calculates price based on a cost value (and some other things). The script works perfectly for the spreadsheet that it was attached to, but I'd like to use this same code across about forty other spreadsheets. Since the values may change over time, I'd like all of the spreadsheets to reference the same custom function file so that I can make an edit once and affect all of the spreadsheets at the same time.

Is there something blatant that I am missing?

I have tried importing as a Macro but that seems to only show up as an option occasionally. I have also tried deploying my Apps script but cannot seem to be able to reference it in each individual Sheet.

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • Yes you are missing a thorough explanation of what you are doing. – Cooper Dec 08 '22 at 20:39
  • Let me try to explain more. I have a series of price sheets that are each their own Google Sheet. We need to run some cost -> price calculations. Those calculations can and will change over time so instead of having sheet specific Apps Scripts I'd like all of the Google Sheets to reference a single Apps Script file to use that calculation custom function. – Peter Noonan Dec 08 '22 at 21:21
  • Please provide [mcve] – Cooper Dec 08 '22 at 21:32
  • @Cooper I'm not quite sure how. I could share a google sheet but the main question is can the code written for one google sheet be "imported" into another sheet? I understand that I could just paste my code into all of my spreadsheets and it would work, but then if I ever had to change a variable, I'd have to change it in forty places. – Peter Noonan Dec 09 '22 at 14:43
  • You can use a library or create an add-on – Cooper Dec 09 '22 at 18:56

0 Answers0