Protect the Same Range of All Tabs

preview_player
Показать описание
How to protect the same asynchronous ranges on every tab on a Sheet.
Important notes:
* The ranges in an array of A1 notation Strings of the ranges. Make sure the quotation marks are around them
* Don't mix up the variables for each FOR() loop

Sheet (to copy from "Make a copy" in File)

Script:
function protectRanges(){
let ranges = ["A1:F5","I1:K1","I3:K3","I5:K5"];
let ss, p;
for (let i in sheets){
ss = sheets[i];
for (let j in ranges){
}
}
}
}

Connect with me:
• Twitter @FarrisSpencer
Рекомендации по теме
Комментарии
Автор

You are a GENIUS. This is EXACTLY what I was looking for, and it works like a miracle! Thank you SO MUCH!

Doktormustache
Автор

THANK YOU SO MUCH!! THIS WAS EXTREMELY HELPFUL!!!

viridianagarcia
Автор

Awesome! Worked the first time.

I needed to protect sheet except certain ranges.

I used your script and manually input all the cells I wanted protected.

If there's a script for protecting the entire sheet (multiple tabs - same ranges to be protected) except certain cells; that would be useful.

CapeFearRiverLife
Автор

You make it sound so easy. Is there an easier way 2 years later?

mrjp
Автор

This is amazing and was exactly what I was looking for. However, it started to not work on sheet 13/19. I am protecting a lot of the sheet as well. Any help would be appreciated. Thank you.

erinyeager
Автор

Wow this is good way to protect the range but I want protect the complete sheets except certain cells pls explain..

MrGulshn
Автор

Hello i wnat o ask you a help. i want to lock the row entre entering a specifing value like " manager" then that row is locked only the person who has the access can edit in case there is mistake during the entring process. please can you help i will be happy. i alredy sent you a message in your email. Thank you

diallooumar
Автор

hi, im looking to do something similar but instead of doing it on all tabs, lets say you want only the same ranges to be protected on Date 4, Date 5 and Date 6 exclusively, how could you do this?

SistemasdeInformacionSalud
Автор

Sorry this is my first time trying to run App Script. When I put in the code and change my ranges this come up. What does this mean? "
"Attempted to execute myFunction, but could not save."

dpolarbear
Автор

Thank You so much for this script and explanation. What if, I have to provide edit access to multiple users? can you please guide me

oddhose
Автор

How to fix

Error
Exceeded maximum execution time


When I started Run process
Please help

znmdkub
Автор

how to apply it on specified ranges only?

dianetipanao
Автор

How to add one more user as an editor?

jcjkged
Автор

Hi, how about automatically protecting the same range when you add a new sheet. And being able to exclude certain sheets from that protection.

Mohammedbasim
Автор

Hi, when i trying to copy protected sheet by script and remove the part of "remove editors" the new tab give a permission to edit for all editors not for the specific editors for this protected part only, there is any solution for that, thanks in advanced

modak
Автор

Script editor is not available in tools
please help

mayuransari
Автор

Hi, I have a script that will duplicate a sheet in tab one, and automatically renames the tab to todays date, but how do I get the new tab/sheet to have the same protected range as the first one? The script that you have up above applies the protected range on tabs already established, but won't apply on the newly created tab/sheet. I just need a little tweak to your code. Any help?

gregmuzzi
Автор

Dear Spencer sir, I have a spreadsheet, where it is used by multiple users. But, i want none of the users to be able to duplicate the tabs. If they want to duplicate the tabs, it should ask for a password. Is this can be done? Please help.

sachinbr
Автор

So just copy the file and add the ranges and then what? This is all so confusing...

XXLRebel