Подскажите пожалуйста, что необходимо изменить в скрипте чтоб от защищал только строки с заполненными значениями ? Ниже код но защищает весь лист сразу
function protectOnEdit(event) { var ss = SpreadsheetApp.getActive(); var range = ss.getRange('Sheet1!A2:A1000'); var timeZone = Session.getScriptTimeZone(); var stringDate = Utilities.formatDate(new Date(), timeZone, 'dd/MM/yy HH:mm'); var description = 'Protected on ' + stringDate; var protection = range.protect().setDescription(description);
// below code taken directly from Google's documentation
var me = Session.getEffectiveUser();
protection.addEditor(me); protection.removeEditors(protection.getEditors()); if (protection.canDomainEdit()) { protection.setDomainEdit(false); } }