1

I currently have a script I am using in the script editor for over 20 spreadsheets. Every time I make a change to one, I have to make a change to the other 19. Is there a way to use one script and reference the rest so that any change I make I only have to do it to one?

1 Answer 1

1

Yes. Use a Library. In your code editor, choose the FILE menu item, and PROPERTIES. A dialog box will pop up. Copy out the project key. Now go to RESOURCES, LIBRARIES, and a dialog box will pop up. In sheets that will not have the original code, enter the project key of the Apps Script, that has the main code.

https://developers.google.com/apps-script/guide_libraries

Keep in mind that there is nothing special you need to do to create a "Library". All a Library is, is code that you've already created. You are just using the Project Key.

Sign up to request clarification or add additional context in comments.

2 Comments

awesome. Thank you. So for sheets that do not have the code do i have to set up the triggers again? I have onedit triggers set for the original script.
Good question. I'm not sure. You might need to experiment.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.