When considering how to secure files and accounts, adding a password for access is often the first thought. Although Google Sheets does not have this as a default feature, it can be achieved using Google Apps Script. Learn how to achieve this by following this tutorial.
At first glance, it may seem impossible to password-protect a Google Sheets spreadsheet. This is because Google Sheets does not have a built-in password feature. Instead, it has a Share feature that allows you to control which Google accounts have access to the data.
However, as we have seen in other tutorials, you can add additional features to google sheets using Google Apps Script. This is what we will use in this tutorial.
Certain sheets may contain sensitive data such as login information, bank information, earnings, etc. if the account used is shared, adding this kind of functionality to the Google Sheets spreadsheet will make sure that even if the account is compromised, there is still a layer of protection that keeps the data from being accessed.
Click the link below to open the template:
The link prompts you to make a copy the sheet alongside its Apps Script files and functionality. Click Make a copy.
To open Google Apps Script, click Extensions on the main toolbar then select Apps Script.
Click the arrow besides the Deploy button, then select New deployment
A box will appear allowing you to configure the deployment. We can opt not to modify these settings. Click Deploy.
As you will run the script for the first time, Google Apps Script will prompt you to Authorize Access to the script. Click Authorize access.
A new window will appear, prompting you to select the Google account to authorize. Select your account.
A page will load, inform you that the app has not been verified by Google. This app is however safe.
Click Advanced, then click Go to ProtectedSheet.
You will be brought next to the page containing lists of permissions required to run the app. Click Allow.
The window will close and you will be brought back to the New deployment box. Click Done.
A small box labeled Finished script indicates that the script has been initialized. We are now ready to add contents to this spreadsheet and encrypt it.
You can now start adding data to the spreadsheet. It is best to store the data starting at Row 3. You will see in the next section why.
When you encrypt the data for the first time, you will be asked to supply a password. Here are the steps:
The data will become encrypted starting Row 3.
The same steps are still applicable if you want to encrypt data again.
Here are the steps to decrypt the data:
You will see the data decrypted in action.
Doing this process can be a necessity, especially if there are changes to those who access the accounts. Here are the steps to replace the old one with a new one.
Follow the steps to encrypt the data in the previous sections to activate the new settings.