0

it is possible to lock one row despite adding other rows? I want to lock whole sheet, unlock one row. When somebody implemented data in row 2, and then add new row before, it is automaticaly blocked new row, now row number 3, and row 2 is open to fill.

Now if I set the whole sheet locked, and only unlock 2:2, then when I add a row before, it automatically becomes unlocked 3:3.

  • To clarify the whole process, you'd like to initially lock your whole sheet then only allow 1 row to be editable, then once data is inputted on the editable row, lock that row and unlock the next row, is this correct? – SputnikDrunk2 Jul 20 '21 at 16:29
  • If you block whole sheet, you can unlock some cells or rows. If I blocked my sheet, and unlocked row number 2, next added new one row before 2, this unlocked row now will be row number 3 and it is unlocked for everyone. Row number 2 is locked. It is possible to agreed one row which will be unlocked for everyone despite adding new row before/after? – Piotr Magdziak Jul 20 '21 at 21:15
  • That is quite a tricky process since protected range will be moved/adjusted when new rows are added. However, you can use this sample Apps Script code from a similar post at https://stackoverflow.com/a/67525225/15384825 (Lock the whole sheet & only allow specific ranges to be editable to users). You can use put the code method inside of an onEdit() trigger (see https://developers.google.com/apps-script/guides/triggers#onedite), this way, whenever a new row is added on your sheet, the script's onEdit trigger will re-process & will unlock the range again that's added on the code. – SputnikDrunk2 Jul 20 '21 at 23:49

0 Answers0