Protect ranges with google apps script
<p>I have a number of sheets which I need to protect except for certain ranges. </p>

<p>Is it possible to do this with a script, as I have several sheets, and many ranges within the sheet which I need to be unprotected so staff can edit the sheets.</p>

<p>The ranges I need to leave unprotected are repetitive, so I'm hoping it's doable. I will fill the ranges I want to remain UNPROTECTED with YELLOW on the example sheet I'll give you.</p>

<p>An example of one of the sheets can be viewed <a href="https://docs.google.com/spreadsheets/d/1n92_Rok9NcCv3Zgx6s5PT-5vU0K4K-3CJlvOAoMm-pk/edit?usp=sharing" rel="noreferrer">here</a>.</p>

<p>As mentioned, I need to protect the whole sheet, apart from these ranges...</p>

<p>N4:V26,N30:V52,N56:V78 etc etc. Basically the rest of the sheet needs to be protected. The unprotected ranges, the columns stay the same, but each unprotected range is separated by three rows which are protected.</p>

<p>If anyone can help with this script I'd be very grateful as it will save me hours of time manually protecting these ranges over many sheets.</p>

<p>Regards Matt</p>