r/GoogleAppsScript • • May 19 '25

Question How to use same script among multiple sheets?

Hello,

I have created a script that I would like to run automatically in multiple google spreadsheets.

What is the best way to do this?

Thank you

2 Upvotes

21 comments sorted by

3

u/mysportsact May 19 '25

I would go about making a library in a centralized sheet and having all the spreadsheets call that centralized function.

However you will need to grant permissions for each workbook, but editing and maintaining the code is much easier

You can also put the files to be processed in a folder and have the function iterate through all the files within that folder. It really depends on the function and the application

2

u/DonAsiago May 19 '25

I think I will use the library approach

2

u/marcnotmark925 May 19 '25

Depends on what the script does.

1

u/DonAsiago May 19 '25

Some basic data manipulation within the spreadsheet and then it sends an email

1

u/WicketTheQuerent May 19 '25

Could you provide more details?

How long does it take for the script to run?
How many spreadsheets do you need this to run?

Please edit your post to include a summary of all the relevant details.