Suppose that your boss wants you to protect an entire workbook, but also wants to be able to change a few cells after you enable protection on the workbook. Before you enabled password protection, you had unlocked some cells in the workbook. Now that your boss is done with the workbook, you can lock these cells.
Follow these steps to lock cells in a worksheet:
-
Select the cells you want to lock.
-
On the Home tab, in the Alignment group, click the small arrow to open the Format Cells popup window.
-
On the Protection tab, select the Locked check box, and then click OK to close the popup.
Note: If you try these steps on a workbook or worksheet you haven’t protected, you’ll see the cells are already locked. This means that the cells are ready to be locked when you protect the workbook or worksheet.
-
On the Review tab in the ribbon, in the Changes group, select either Protect Sheet or Protect Workbook, and then reapply protection. See Protect a worksheet or Protect a workbook.
Tip: It’s a best practice to unlock any cells that you may want to change before you protect a worksheet or a workbook, but you can also unlock them after you apply protection. To remove protection, simply remove the password.
In addition to protecting workbooks and worksheets, you can also protect formulas.
Excel for the web can’t lock cells or specific areas of a worksheet.
If you want to lock cells or protect specific areas, click Open in Excel and lock cells to protect them or lock or unlock specific areas of a protected worksheet.
By default, protecting a worksheet locks all cells so none of them are editable. To enable some cell editing, while leaving other cells locked, it’s possible to unlock all the cells. You can lock only specific cells and ranges before you protect the worksheet and, optionally, enable specific users to edit only in specific ranges of a protected sheet.
Lock only specific cells and ranges in a protected worksheet
Follow these steps:
-
If the worksheet is protected, do the following:
-
On the Review tab, click Unprotect Sheet (in the Changes group).
Click the Protect Sheet button to Unprotect Sheet when a worksheet is protected.
-
If prompted, enter the password to unprotect the worksheet.
-
-
Select the whole worksheet by clicking the Select All button.
-
On the Home tab, click the Format Cell Font popup launcher. You can also press Ctrl+Shift+F or Ctrl+1.
-
In the Format Cells popup, in the Protection tab, uncheck the Locked box and then click OK.
This unlocks all the cells on the worksheet when you protect the worksheet. Now, you can choose the cells you specifically want to lock.
-
On the worksheet, select just the cells that you want to lock.
-
Bring up the Format Cells popup window again (Ctrl+Shift+F).
-
This time, on the Protection tab, check the Locked box and then click OK.
-
On the Review tab, click Protect Sheet.
-
In the Allow all users of this worksheet to list, choose the elements that you want users to be able to change.
More information about worksheet elements
Clear this check box
To prevent users from
Select locked cells
Moving the pointer to cells for which the Locked check box is selected on the Protection tab of the Format Cells dialog box. By default, users are allowed to select locked cells.
Select unlocked cells
Moving the pointer to cells for which the Locked check box is cleared on the Protection tab of the Format Cells dialog box. By default, users can select unlocked cells, and they can press the TAB key to move between the unlocked cells on a protected worksheet.
Format cells
Changing any of the options in the Format Cells or Conditional Formatting dialog boxes. If you applied conditional formats before you protected the worksheet, the formatting continues to change when a user enters a value that satisfies a different condition.
Format columns
Using any of the column formatting commands, including changing column width or hiding columns (Home tab, Cells group, Format button).
Format rows
Using any of the row formatting commands, including changing row height or hiding rows (Home tab, Cells group, Format button).
Insert columns
Inserting columns.
Insert rows
Inserting rows.
Insert hyperlinks
Inserting new hyperlinks, even in unlocked cells.
Delete columns
Deleting columns.
If Delete columns is protected and Insert columns is not also protected, a user can insert columns that he or she cannot delete.
Delete rows
Deleting rows.
If Delete rows is protected and Insert rows is not also protected, a user can insert rows that he or she cannot delete.
Sort
Using any commands to sort data (Data tab, Sort & Filter group).
Users can’t sort ranges that contain locked cells on a protected worksheet, regardless of this setting.
Use AutoFilter
Using the drop-down arrows to change the filter on ranges when AutoFilters are applied.
Users cannot apply or remove AutoFilters on a protected worksheet, regardless of this setting.
Use PivotTable reports
Formatting, changing the layout, refreshing, or otherwise modifying PivotTable reports, or creating new reports.
Edit objects
Doing any of the following:
-
Making changes to graphic objects including maps, embedded charts, shapes, text boxes, and controls that you did not unlock before you protected the worksheet. For example, if a worksheet has a button that runs a macro, you can click the button to run the macro, but you cannot delete the button.
-
Making any changes, such as formatting, to an embedded chart. The chart continues to be updated when you change its source data.
-
Adding or editing comments.
Edit scenarios
Viewing scenarios that you have hidden, making changes to scenarios that you have prevented changes to, and deleting these scenarios. Users can change the values in the changing cells, if the cells are not protected, and add new scenarios.
Chart sheet elements
Select this check box
To prevent users from
Contents
Making changes to items that are part of the chart, such as data series, axes, and legends. The chart continues to reflect changes made to its source data.
Objects
Making changes to graphic objects — including shapes, text boxes, and controls — unless you unlock the objects before you protect the chart sheet.
-
-
In the Password to unprotect sheet box, type a password for the sheet, click OK, and then retype the password to confirm it.
-
The password is optional. If you do not supply a password, any user can unprotect the sheet and change the protected elements.
-
Make sure that you choose a password that is easy to remember, because if you lose the password, you won’t have access to the protected elements on the worksheet.
-
Unlock ranges on a protected worksheet for users to edit
To give specific users permission to edit ranges in a protected worksheet, your computer must be running Microsoft Windows XP or later, and your computer must be in a domain. Instead of using permissions that require a domain, you can also specify a password for a range.
-
Select the worksheet that you want to protect.
-
On the Review tab, in the Changes group, click Allow Users to Edit Ranges.
This command is available only when the worksheet is not protected.
-
Do one of the following:
-
To add a new editable range, click New.
-
To modify an existing editable range, select it in the Ranges unlocked by a password when sheet is protected box, and then click Modify.
-
To delete an editable range, select it in the Ranges unlocked by a password when sheet is protected box, and then click Delete.
-
-
In the Title box, type the name for the range that you want to unlock.
-
In the Refers to cells box, type an equal sign (=), and then type the reference of the range that you want to unlock.
You can also click the Collapse Dialog button, select the range in the worksheet, and then click the Collapse Dialog button again to return to the dialog box.
-
For password access, in the Range password box, type a password that allows access to the range.
Specifying a password is optional when you plan to use access permissions. Using a password allows you to see user credentials of any authorized person who edits the range.
-
For access permissions, click Permissions, and then click Add.
-
In the Enter the object names to select (examples) box, type the names of the users who you want to be able to edit the ranges.
To see how user names should be entered, click examples. To verify that the names are correct, click Check Names.
-
Click OK.
-
To specify the type of permission for the user who you selected, in the Permissions box, select or clear the Allow or Deny check boxes, and then click Apply.
-
Click OK two times.
If prompted for a password, type the password that you specified.
-
In the Allow Users to Edit Ranges dialog box, click Protect Sheet.
-
In the Allow all users of this worksheet to list, select the elements that you want users to be able to change.
More information about the worksheet elements
Clear this check box
To prevent users from
Select locked cells
Moving the pointer to cells for which the Locked check box is selected on the Protection tab of the Format Cells dialog box. By default, users are allowed to select locked cells.
Select unlocked cells
Moving the pointer to cells for which the Locked check box is cleared on the Protection tab of the Format Cells dialog box. By default, users can select unlocked cells, and they can press the TAB key to move between the unlocked cells on a protected worksheet.
Format cells
Changing any of the options in the Format Cells or Conditional Formatting dialog boxes. If you applied conditional formats before you protected the worksheet, the formatting continues to change when a user enters a value that satisfies a different condition.
Format columns
Using any of the column formatting commands, including changing column width or hiding columns (Home tab, Cells group, Format button).
Format rows
Using any of the row formatting commands, including changing row height or hiding rows (Home tab, Cells group, Format button).
Insert columns
Inserting columns.
Insert rows
Inserting rows.
Insert hyperlinks
Inserting new hyperlinks, even in unlocked cells.
Delete columns
Deleting columns.
If Delete columns is protected and Insert columns is not also protected, a user can insert columns that he or she cannot delete.
Delete rows
Deleting rows.
If Delete rows is protected and Insert rows is not also protected, a user can insert rows that he or she cannot delete.
Sort
Using any commands to sort data (Data tab, Sort & Filter group).
Users can’t sort ranges that contain locked cells on a protected worksheet, regardless of this setting.
Use AutoFilter
Using the drop-down arrows to change the filter on ranges when AutoFilters are applied.
Users cannot apply or remove AutoFilters on a protected worksheet, regardless of this setting.
Use PivotTable reports
Formatting, changing the layout, refreshing, or otherwise modifying PivotTable reports, or creating new reports.
Edit objects
Doing any of the following:
-
Making changes to graphic objects including maps, embedded charts, shapes, text boxes, and controls that you did not unlock before you protected the worksheet. For example, if a worksheet has a button that runs a macro, you can click the button to run the macro, but you cannot delete the button.
-
Making any changes, such as formatting, to an embedded chart. The chart continues to be updated when you change its source data.
-
Adding or editing comments.
Edit scenarios
Viewing scenarios that you have hidden, making changes to scenarios that you have prevented changes to, and deleting these scenarios. Users can change the values in the changing cells, if the cells are not protected, and add new scenarios.
Chart sheet elements
Select this check box
To prevent users from
Contents
Making changes to items that are part of the chart, such as data series, axes, and legends. The chart continues to reflect changes made to its source data.
Objects
Making changes to graphic objects — including shapes, text boxes, and controls — unless you unlock the objects before you protect the chart sheet.
-
-
In the Password to unprotect sheet box, type a password, click OK, and then retype the password to confirm it.
-
The password is optional. If you do not supply a password, then any user can unprotect the worksheet and change the protected elements.
-
Ensure that you choose a password that you can remember. If you lose the password, you will be unable to access to the protected elements on the worksheet.
-
If a cell belongs to more than one range, users who are authorized to edit any of those ranges can edit the cell.
-
If a user tries to edit multiple cells at once and is authorized to edit some but not all of those cells, the user will be prompted to edit the cells one-by-one.
Need more help?
You can always ask an expert in the Excel Tech Community or get support in the Answers community.
Most people know that you can protect individual rows, columns, or cells in Excel. You can even protect the entire sheet. What they’re not aware of, however, is that you can protect only specific parts of a spreadsheet, parts that are more than a few columns or rows, but not quite the entire workbook.
This level of protection comes in handy when working with multiple users on the same sheet. Now, you can lock the area you’re responsible for and stop worrying that a collaborator will accidentally edit it.
- How to use Microsoft Excel like a pro and how to recover a deleted or unsaved file in Excel
- How to convert Excel spreadsheets to Google Sheets
- How to transpose columns and rows using Paste Special in Excel
How to protect cells, columns, and rows from accidental editing
1. Open Excel and select a workbook. For the sake of this tutorial, I’m going to use one of Excel’s default templates.
2. First we have to unlock the workbook, which is typically locked (as a whole) by default. To do that, press Ctrl + A to select the entire document.
3. Right click and choose Format cells.
4. Under the Protection tab, uncheck Locked. If it’s not checked by default, you’re ready to go. <uncheck.png>
5. Press OK.
With your workbook now unlocked, we can set about locking specific areas. For the sake of this tutorial, we’re going to pretend we’re responsible for Column B, C, and D.
6. Select the area of the workbook you’d like to protect.
7. Right click and select Format cells. Alternatively, you can use the keyboard shortcut Ctrl + 1.
8. Check Locked and press OK.
In an Excel workbook, nothing is ever really locked until you protect the sheet. We’re going to do that next.
9. Under the Review tab (in the Ribbon), choose Protect Sheet.
10. Add a password (if desired), and choose what you’d like other users to be able to edit in your protected section. If you’d rather them not touch it at all, uncheck each of the boxes and press OK.
Now, if you try clicking in any of the three columns we protected, nothing happens. Just the way we wanted it.
- 10 Excel Business Tips You Need to Keep Your Job
- How to Use Microsoft Outlook Like a Pro
- 10 Microsoft Word Tips That Will Save Your Job
Get instant access to breaking news, the hottest reviews, great deals and helpful tips.
(Note: This guide on how to lock a row in Excel is suitable for all Excel versions including Office 365)
When working with data, Excel can be an invaluable tool to help you organize, analyze, and visualize data. But imagine if you’re working on a large spreadsheet and you don’t want certain rows to move when you scroll. No need to stress as Excel allows you to lock a row in place so that it remains visible as you scroll down or to the side.
If you don’t know how to do it, worry not! In this article, I will tell you how to lock a row in Excel in 4 proven useful ways.
You’ll learn:
- What Is a Locked Row?
- How to Lock a Row in Excel?
- By Using Freeze Panes
- By Using Protect Sheet
- By Using data Validation
- By Using Conditional Formatting
- How to Lock a Row in Excel in 7 Simple Steps?
- Benefits of Locking Rows in Excel
Related Reads
HOW TO DELETE ROWS IN EXCEL? 6 EFFICIENT WAYS
HOW TO CHANGE ROW HEIGHT IN EXCEL? 5 EASY WAYS
HOW TO FREEZE ROWS IN EXCEL? 4 EASY STEPS
What Is a Locked Row?
Before moving on to see how to lock a row in Excel, let us first understand what a locked row is.
A locked row in Excel is a row that is protected from changes. This means that any changes you make to the sheet will not affect the locked row, and you will not be able to delete, insert, or move it.
Locking rows in Excel allows you to protect critical information and maintain the integrity of your data. While there’s no limit to the number of rows you can lock in Excel, it’s important to note that locked rows are only effective when the entire sheet or workbook is protected.
Once you lock a row, Excel adds a lock symbol to the upper-left corner of the row. You can also tell if a row is locked by looking for a thin line at the top of the row.
Sometimes, Excel may prevent you from locking a row in certain circumstances. For example, if you’re trying to lock the header row of a table, Excel won’t allow it. This is because the header row is usually used to identify the columns in a worksheet, and locking it would prevent you from being able to make changes to the table.
Another example can be found when working with an Excel spreadsheet that contains formulas. If you try to lock a row that has a formula in it, Excel won’t let you. This is because the formulas rely on data in other cells, and locking the row would prevent the formula from accessing the necessary data.
How to Lock a Row in Excel?
There are several ways to lock a row in Excel:
By Using Freeze Panes
Freeze panes allow you to lock certain rows and columns in place so that when you scroll down or across the worksheet, the locked rows and columns remain visible.
- To do this, select the row below the row you want to lock, then go to View. Click on the dropdown from Freeze Panes and select Freeze Panes. This will lock all rows above the row you selected.
By Using Protect Sheet
You can also lock a row in Excel by using the Protect Sheet feature. The Protect Sheet feature in Excel is a security feature that enables users to lock certain parts of a worksheet, such as cells, ranges, objects, or sheets.
Using the Protect Sheet feature, you can prevent other users from making changes to the data or formatting a specific worksheet. It also allows you to set permissions for other users, so they can view and edit specific parts of the worksheet.
- To do this, go to Home. Click on the dropdown from Format and click on Protect Sheet. Select the Locked checkbox next to the rows you want to lock. You can also select the Hidden checkbox to hide the locked rows.
By Using data Validation
Data validation is a feature in Excel that allows you to restrict values that can be entered into a cell.
- To lock a row in Excel using data validation, select the row you want to lock, then go to Data. Click on the dropdown from Data Validation. Select the Allow only list and enter the values you want to allow. This will lock the row so that no other values can be entered.
By Using Conditional Formatting
Conditional formatting is a feature in Excel that allows you to set rules for when a cell should be formatted based on the value in the cell.
- To lock a row in Excel using conditional formatting, select the row you want to lock, then go to Home. Click on the dropdown from Conditional Formatting and click on New Rule. Select the Format-only cells that contain the option and enter the values you want to allow. This will lock the row so that no other values can be entered.
Now the question is how to lock a row in Excel, the easy way.
Suggested Reads
HOW TO MOVE ROWS IN EXCEL? 5 EASY METHODS
HOW TO USE THE EXCEL COLLAPSE ROWS FEATURE? — 4 EASY STEPS
ARROW KEYS NOT WORKING IN EXCEL – 4 EASY FIXES
How to Lock a Row in Excel in 7 Simple Steps?
Suppose you are working on a spreadsheet in Excel and want to lock a certain row so that it cannot be edited or moved. Just follow these simple steps.
- Step 1. Select the row or rows you wish to lock. You can do this by clicking and dragging on the row headers. To select adjacent or non-adjacent rows, hold the keys Shift or Ctrl and select the individual rows respectively.
- Step 2. Right-click the selection and select “Format Cells” from the popup menu.
- Step 3. Select the “Protection” tab in the Format Cells dialog box.
- Step 4. Check the “Locked” box and click “OK” to close the dialog box.
- Step 5. But if you want to protect the spreadsheet, go to the “Review” tab, click on “Protect Sheet,” and then enter a password if you want to.
- Step 6. Click “OK,” and the selected row will be locked.
- Step 7. To unlock a row, follow the same steps, but uncheck the “Locked” box in the Format Cells dialog box.
Benefits of Locking Rows in Excel
Locking rows in Excel provides the following benefits:
- Protect Data: Locking rows and columns in a spreadsheet can protect essential data from being accidentally deleted or changed. This is especially useful when you have formulas that rely on specific data in the spreadsheet.
Related Read: How to Password Protect an Excel File? 2 Effective Ways
- Prevent Accidental Editing: It’s very easy for users to accidentally delete or modify data in a spreadsheet. Locking rows and columns can help prevent accidental editing from happening.
- Ensure Formula Integrity: If a formula in a spreadsheet relies on specific data, locking rows and columns can ensure that the formula remains intact. This can be especially important when working with complex formulas.
- Easily Unlock and Lock Rows: With modern versions of Excel, users can easily lock and unlock rows or columns with a few clicks. This makes it very easy to access and protect data in a spreadsheet.
- Improved User Experience: Locking rows and columns can improve the user experience by preventing accidental editing and helping users find the data they need. This can be especially useful when working with complex spreadsheets.
Also Read
HOW TO INSERT MULTIPLE ROWS IN EXCEL? THE 4 BEST METHODS
HOW TO SHADE EVERY OTHER ROW IN EXCEL? (5 BEST METHODS)
HOW TO SUBTRACT IN EXCEL?- 4 DIFFERENT SCENARIOS
Frequently Asked Questions
What is a locked row in Excel?
A locked row in Excel is a row that has been protected from changes. This means that any changes you make to the sheet will not affect the locked row, and you will not be able to delete, insert, or move the row.
How do I lock a row in Excel?
There are several ways to lock a row in Excel, including Freeze Panes, Protect Sheets, Data Validation, and Conditional Formatting. Each method has its advantages and disadvantages, so you should choose the one that best suits your needs.
What are the benefits of locking rows in Excel?
Locking rows in Excel can effectively protect important data, prevent accidental editing, and ensure that formulas in the spreadsheet remain intact. It also improves the user experience by preventing accidental editing and helping users find the data they need.
Closing Thoughts
Locking rows and columns in Excel can be a great way to protect important data, prevent accidental editing, and ensure that formulas remain intact. And it’s very easy to do with modern versions of Excel.
So, if you’re working with sensitive data or complex formulas, it’s a good idea to use the locking feature in Excel to keep your data safe.
Please visit our free resources center for more high-quality Excel and Microsoft Suite application guides.
Ready to dive deep into Excel? Click here for advanced Excel courses with in-depth training modules.
Simon Sez IT taught Excel and other business software for over ten years. You can access 150+ IT training courses for a low monthly fee.
Simon Calder
Chris “Simon” Calder was working as a Project Manager in IT for one of Los Angeles’ most prestigious cultural institutions, LACMA.He taught himself to use Microsoft Project from a giant textbook and hated every moment of it. Online learning was in its infancy then, but he spotted an opportunity and made an online MS Project course — the rest, as they say, is history!
Bottom Line: Learn how to lock individual cells or ranges in Excel so that users cannot change the formulas or contents of protected cells. Plus a few bonus tips to save time with the setup.
Skill Level: Beginner
Video Tutorial
Download the Excel File
You can download the file that I use in the video tutorial by clicking below.
Protecting Your Work from Unwanted Changes
If you share your spreadsheets with other users, you’ve probably found that there are specific cells you don’t want them to modify. This is especially true for cells that contain formulas and special formatting.
The great news is that you can lock or unlock any cell, or a whole range of cells, to keep your work protected. It’s easy to do, and it involves two basic steps:
- Locking/unlocking the cells.
- Protecting the worksheet.
Here’s how to prevent users from changing some cells.
Step 1: Lock and Unlock Specific Cells or Ranges
Right-click on the cell or range you want to change, and choose Format Cells from the menu that appears.
This will bring up the Format Cells window (keyboard shortcut for this window is Ctrl + 1.). Choose the tab that says Protection.
Next, make sure that the Locked option is checked.
Locked is the default setting for all cells in a new worksheet/workbook.
Once we protect the worksheet (in the next step) those locked cells will not be able to be altered by users.
If you want users to be able to edit a particular cell or range, uncheck the Locked box so they are unlocked. Since cells are locked by default, most of the job will be going through the sheet and unlocking cells that can be edited by users.
I share some shortcuts to make this process faster in the Bonus section below.
Step 2: Protect the Worksheet
Now that you’ve locked/unlocked the cells that you want users to be able to edit, you want to protect the sheet. Once you protect the sheet, users cannot change the locked cells. However, they can still modify the unlocked cells.
To protect the sheet, simply right-click on the tab at the bottom of the sheet, and choose Protect Sheet… from the menu.
This will bring up the Protect Sheet window. If you want your sheet to be password protected, you have the option of entering a password here. Adding a password is optional. Click OK.
If you’ve chosen to enter a password, then you will be prompted to verify your entry after you’ve clicked OK.
With the sheet protected, users will be unable to change the cells that are locked. If they try to make changes, they will get an error/warning message that looks like this.
You can unprotect the sheet in the same way that you protected it, by right-clicking on the sheet tab. An alternative way to protect and unprotect sheets is by using the Protect Sheet button in the Review tab of the Ribbon.
The button text displays the opposite of the current state. It says Protect Sheet when the sheet is unprotected, and Unprotect Sheet when it is protected.
It’s important to note that all cells can be edited when the sheet is unprotected. After making changes you must protect the sheet again and Save the workbook before sending or sharing with other users.
3 Bonus Tips for Locking Cells and Protecting Sheets
As you can see, it is fairly simple to protect your formulas and formatting from being changed! But I’d like to leave you with three tips to help make it faster & easier for both you and your users.
1. Prevent Locked Cells From Being Selected
This tip will help make it faster and easier for your users to input data in the sheet.
Turning off the Select locked cells option prevents the locked cells from being selected with either the mouse or keyboard (arrow or tab keys). This means users will only be able to select the unlocked cells that they need to edit. They can quickly hit the Tab, Enter, or arrow keys to move to the next editable cell.
To make this change, you just uncheck the option that says “Select locked cells” on the Protect Sheet window.
After pressing OK, you will only be able to select the unlocked cells.
2. Add a button for locking cells to the Quick Access Toolbar
This allows you to quickly see the locked setting for a cell or range.
From the Home tab on the Ribbon, you can open the drop-down menu under the Format button and see the option to Lock Cell.
If you right-click on the Lock Cell option, another menu appears giving you the option to add the button to the Quick Access Toolbar.
When you select this option, the button will be added to the Quick Access Toolbar at the top of the workbook. This button will remain each time you use Excel. You can easily lock and unlock specific cells on your sheet by clicking on this button.
You can also see if the active cell locked or unlocked. The button will have a dark background if the selection is locked.
It’s important to note that this only shows the locked state of the active cell. If you have multiple cells selected, the active cell is the cell you selected first and appears with no fill shading.
Mixed Lock State
If you select a range that contains both locked and unlocked cells, you will see a solid box for the Locked checkbox in the Format Cells window. This denotes the mixed state.
You can click the checkbox to lock or unlock ALL cells in the selected range.
3. Use different formatting for locked cells
By changing the formatting of cells that are locked, you give your users a visual clue that those cells are off limits. In this example the locked cells have a gray fill color. The unlocked (editable) cells are white. You can also provide a guide on the sheet or instructions tab.
You might be wondering where I found this template for a quote. I got it from the template library. You can access the library by going to the File tab, choosing New, and using the search word “quote.”
You can find all sorts of useful templates there, including invoices, calendars, to-do lists, budgets, and more.
Conclusion
By locking your cells and protecting your sheet, you can keep your formulas safe from tampering by other users, and prevent mistakes.
I hope this simple tutorial proves helpful to you. Please leave a comment below if you have any tips or questions about locking cells, protecting sheets with passwords, or preventing users from changing cells.
Thank you! 🙂