Relative Content

Tag Archive for google-sheetsgoogle-apps-scriptspreadsheet

Preventing or removing multiple instances of same range protected cells

I have two separate spreadsheets, one for admin and one for user. The admin can lock or unlock certain ranges for either Fri, Sat, Sun or Holiday via onEdit trigger (ie fridaycheck(). When checkmark is removed those same ranges are removed. The problem is when admin checkmarks all the boxes at once and before any of the separate scripts can complete. When they finally do complete multiple protection instances exist for each of the days. When admin checks one day at a time and script is allowed to finish, everything works fine. Looking to try and prevent multiple protection instances from being inserted OR remove all instances when the check mark is removed. Here are the scripts for Fri onEdit check, lock and unlock. Any suggestions would be greatly appreciated! Thanks, Paul two overlapping spreadsheets with checkmarks entered at same time and then the corresponding protection in user spreadsheet.