Reputation: 141
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.
Upvotes: 14
Views: 26106
Reputation: 373
Found Solution In this site.
Go to Data -> Protected Sheet & Ranges
https://www.howtogeek.com/412399/how-to-protect-cells-from-editing-in-google-sheets/
Upvotes: 3
Reputation: 1414
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)
Upvotes: 22