I have a complex script that currently takes about 32 seconds to run. It handles various operations in Google Sheets, including updating multiple sheets based on user edits, applying formulas, and managing data validation rules.
The script includes functions like:
updateQuoteDetail,
updateQuoteSummary,
copyAllQuoteData,
hideOrShowSpecificSheets,
I’m looking for advice on how to optimize this script to reduce its execution time.
I’m open to restructuring the code if it leads to significant performance improvements. Any insights or suggestions would be greatly appreciated!
Thank you in advance for your help!”
This message outlines your current situation, specifies what kind of help you’re looking for, and invites the community to share their expertise. It should encourage knowledgeable members to offer their insights on optimizing Google Apps Script performance.
Best Regards,
Saher
This is the script:
Dropbox>txt.file
What I Tried:
- Script Optimization: I attempted to optimize my Google Sheets script for performance.
- Deleting Rows: I deleted every row in Google Sheets after row 80, hoping to reduce processing time, but this did not yield significant results.
- Adjusting Ranges: I changed the ranges from “B14:R122” and “B14:R” to “B14:R80” to limit the data being processed, but this only provided a minor improvement.
- Deleting Sheets: I removed some sheets.
- Results: All these actions only reduced the execution time from 32 seconds to 25 seconds.
What I Expected:
I expected the script to finish running in about 5 seconds.
Actual Outcome:
The script currently takes 25 seconds to complete, which is still longer than desired.