Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a Google Sheets document cells to read-only

I am trying to find a way to protect a Google Sheets spreadsheet document from being modified by the owner. In other words, I want to make the cells of my Google Sheets spreadsheet to be read-only.

How can I create a script, assigned to a button, that would accomplish this?

Specifically, I need two features:

1) Make the sheet read-only.
2) Modify a specific cell, then make the sheet read-only again.

like image 487
Davide Malandrino Avatar asked Feb 01 '17 09:02

Davide Malandrino


People also ask

How do you make a Google Doc read only?

Find the file or folder in Google Drive, Google Docs, Google Sheets, or Google Slides. Open or select the file or folder. Select Restricted. Click Done.

How do you lock a Google Doc from editing?

Go to the Run menu, choose Run function > makeFileReadyOnly . Accept the permissions and your file will restricted from editing by anyone including yourself.

How do I protect cells in Google Sheets 2021?

Protecting Your Data Google Sheets allows you to that by following the steps: Click on “Data” > “Protected Sheets and Ranges.” Then choose between “Range” to protect a specific range of cells or “Sheet” to protect the entire spreadsheet.


1 Answers

I'm not sure if you mean you, as the owner of the sheet, are unable to edit it or if everyone except you is unable to edit it.

Either way, go to the Data menu and click 'Protected sheets and ranges'. In the sidebar, click 'add a range', add a description if you like, choose 'range' from 'range/sheet', add the cell reference you wish to protect and:

If you want others to be unable to edit it: Change permission drop down to 'Only me'

If you want to be unable to edit it: Change permissions to 'Edit with warning' (This is the best I can think of, because as the owner of the sheet, you cannot prevent yourself from editing cells, but this will alert you if you try change a cell you wish to protect)

like image 100
CalamitousCode Avatar answered Oct 16 '22 21:10

CalamitousCode