Note: Unlocking the cells after applying the VBA code follows the same unlocking method explained earlier.After protecting a worksheet, by default, each and every cell are locked.But protecting different cells gives you the freedom to work on the unprotected cells.This article provides you the different techniques of how to lock cells in Excel.
Lock Cells In Excel Keyboard Shortcut Code Follows TheWe will also see the other techniques of locking and unlocking columns and rows in Excel. Table of Contents How to lock certain cells in Excel How to unlock cells in excel Locking cells with Excel VBA How to freeze rows and columns in excel Print frozen panes How to Protect Cells in a Shared Worksheet Conclusion Read More How to lock certain cells in Excel At First, we will need to select the cells we want to lock. After selecting the cells press on the right click button of the mouse. After the Format cells window open, press on the Protection option and click on the Locked option. After clicking on the Review option on top, click on the Protect Sheet option. After this whenever you want to edit the desired cells of the excel you will see a warning box indicating that you can not edit the cells as it is protected. For locking rows and columns just move the mouse courser to the row heading or column heading. For columns a downward arrow and for the row, a rightward arrow will come up. How to unlock cells in excel Unlocking the cells in excel is much easier. Just click on the Review option on top, click on the Unprotect Sheet. Unlocking the rows and columns of excel follows the same rule. If you dont want to give any password while protecting a sheet its completely your choice. Locking cells with Excel VBA There is another way of protecting cells, rows, and columns of excel using the VBA code. ![]() ![]() A new dialogue box of Microsoft Visual Basic for Applications will come up. In the white sheet associated with the dialogue box, write down the below code. Lock Cells In Excel Keyboard Shortcut Full Image InClick to view full image In the code, we select the range of data from C7 to E11 and set the password 1234. After this, Under the Debug option, you will find a Run SubUserForm (F5). Click on it. Your Excel worksheet will come up along with a password window. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |