I am am writing a script in Google Sheets that selectively locks a large block of cells, and each day will need to include one more row of cells into that same protected range.
The script is working so far, in terms of locating the rows that need protection and creating a new protected range each time it is run -- however every time it is run (which I want to be onOpen) it creates another protected range, and another, and another. I've named the protected range "History" but I cannot figure out a way to, upon the next run, unprotect just that range and then protect a new range.
There are other protected cells in the sheet, so I cannot simply remove all protections and then proceed - I need to be able to delete just this one, specifically, and go from there. Since the range of cells being locked is going to keep changing, I need to be able to have the script look for this one range specifically.
Any ideas are appreciated!