How to Lock Cells In Excel: A Complete Guide
Last Updated :
05 Feb, 2025
How to Protect Cells in Excel Spreadsheet- Quick Steps
- Select the cells you want to protect.
- Right-click, choose Format Cells>>Go to the Protection tab>> check Locked.
- Go to the Review tab>> click Protect Sheet >> set a password (optional) >>click OK.
Locking cells in Excel or Protecting Cells in Spreadsheet is essential for protecting your data from unintended edits, especially in shared or collaborative workbooks. When you lock cells, you can prevent changes to specific parts of a worksheet, ensuring that formulas, values, and structure remain intact.
This complete guide covers everything you need to know about locking cells in Excel. From locking specific cells or formulas to protecting entire worksheets, we’ll walk you through step-by-step instructions. You’ll also learn how to lock cells without protecting the entire sheet, unlock cells when needed, and even freeze rows and columns for easier navigation.

Why Lock Cells in Excel
Locking cells in Excel is helpful when you want to:
- Protect formulas from accidental changes.
- Limit access to specific areas in a shared workbook.
- Ensure that certain values and structures remain consistent and untouched.
- Allow only authorized users to edit specific cells.
How to Lock Specific Cells in Excel
If you want to protect specific cells but allow edits to others, follow these steps:
Step 1: Select the Cells to Lock
Highlight the cells or range of cells you want to lock.
Select Cells or Range of CellsRight-click the selected cells and choose Format Cells, or press Ctrl + 1 to open the Format Cells dialog box.
Right Click and then Click Format CellsStep 3: Enable the Locked Option
- In the Format Cells dialog, go to the Protection tab and check the Locked option.
- Click OK to apply the changes.
Enable the Locked Option and Click OKStep 4: Protect the Worksheet
- Go to the Review tab in the Excel Ribbon.
- Click Protect Sheet
- If desired, enter a password to prevent unauthorized users from unprotecting the sheet.
- Click OK to apply the protection.
Go to Review Tab >> Click on Protect Sheet>> Set the Password >>Press OKStep 5: Preview the Results
Excel will display a warning, as shown in the image below, if you attempt to make any changes to locked cells.
Cells LockedHow to Lock All Cells in Excel
To lock all cells in an Excel worksheet, follow these steps:
Step 1: Select All Cells
Press Ctrl + A to select the entire worksheet.
Right-click on any selected cell and choose Format Cells.
Click on Format CellsStep 3: Enable the Locked Option
- Go to the Protection tab in the Format Cells dialog.
- Make sure the Locked checkbox is checked and click OK.
Click on Protection TabStep 4: Protect the Sheet
- Go to the Review tab and click Protect Sheet.
Go to Review Tab>> Click on Protect Sheet>>Set the Password >> Press OKStep 5: Preview Results
Excel will show a warning alert if you attempt to edit the data in locked cells.
Warning AlertHow to Protect a Worksheet in Excel
Protecting a worksheet in Excel not only locks cells but also ensures that your entire sheet (or specific parts of it) is safeguarded from unwanted changes. Here’s how you can protect a worksheet step by step:
Step 1: Go to the Review Tab
Navigate to the Review tab in the Excel toolbar (or press Alt + R)
Step 2: Click on "Protect Sheet"
In the Review tab, click Protect Sheet. A dialog box will appear.
Alternatively Press the Shortcut (Alt + R + P + S)
Go to review tab>>Click on Protect SheetStep 3: Set a Password (Optional)
Enter a password if you want to restrict access to the protection settings. Make sure to remember this password, as it will be required to unprotect the sheet.
Choose PasswordStep 4: Choose the Protection Options
Select which actions users can perform, such as:
- Selecting locked or unlocked cells
- Formatting cells
- Inserting rows or columns
- Deleting columns or rows
Step 5: Click OK
Confirm your settings by clicking OK.
Your worksheet is now protected, meaning any locked cells cannot be edited unless the sheet is unprotected. This is a great way to ensure the integrity of your data, especially when sharing your spreadsheet with others.
Tip: If you need to make changes later, you can unprotect the sheet by returning to the Review tab and clicking Unprotect Sheet. Enter the password if prompted.
To protect only the cells containing formulas while allowing other cells to remain editable, follow these steps:
Disclaimer: Always Unlock Non-Formula Cells First!
Before protecting the sheet, make sure to unlock non-formula cells if you want them to remain editable. Select those cells, go to Format Cells → Protection, and uncheck "Locked".
Step 1: Select All Cells
- Press Ctrl + A to select the entire worksheet.
Select All CellsStep 2: Unlock All Cells
- Right-click the selected cells and choose Format Cells (Ctrl + 1).
- In the Protection tab, uncheck the Locked box.
- Click OK to apply the changes.
Right-Click >> Select Format Cells>>Click Locked Cells- Go to the Home tab, click Find & Select, and choose Go To Special (Or Press Ctrl + G).
- Select Formulas and click OK to highlight all the cells that contain formulas.
Go to Home Tab>>> Click on Find & Select >>Select Go to Special>> Select Formulas>>Click ok- Right-click the selected formula cells and choose Format Cells ( Or Press Ctrl + 1)
- In the Protection tab, check the Locked box and click OK.
Select the Formula Cells>> Select "Format Cells">> Click on Protection Tab>> Click on Locked >> Press OKStep 5: Protect the Sheet
- Go to the Review tab and click Protect Sheet.
- Optionally, set a password to restrict changes.
- Click OK to apply the protection.
(Alternatively, Press the Shortcut Alt + R + P + S)
Go to Review Tab >>Click on Protect Sheet>>Set the Password >>Click okResult: The formula cells are now locked and cannot be edited, while other cells in the worksheet remain editable.
Lock Cells Without Protecting the Entire Sheet
If you want to restrict cell editing in Excel without locking the whole sheet, you can lock specific cells while leaving others editable. Here's how to do it:
Step 1: Select the Cells You Want to Protect
Highlight the cells you wish to lock.
Highlight the CellsRight-click the selected cells and choose Format Cells (or use the shortcut Ctrl + 1)
Right Click and Select Format CellsStep 3: Enable the Locked Option
In the Protection tab, ensure the Locked checkbox is checked.
Enable the Locked OptionStep 4: Allow Edit Ranges
Go to the Review tab and click Allow Edit Ranges.
Alternatively Use the Shortcut (Alt + R + R).
Step 5: Define the Range
In the Allow Users to Edit Ranges dialog box, click New to define the range of cells you want to lock.
Allow Edit Range>> Define the RangeHow to Unlock Cell Lock in Excel
By default, all cells are locked for editing in a spreadsheet, but it has no effect until you protect the worksheet. If you need to remove the lock from previously locked cells:
Step 1: Select All Cells
Press "Ctrl+A" on your keyboard to select all cells. (To select a whole range of sheets).
Select All CellsRight-click on the selected cells and select the FormatCells option from the dropdown.

Step 3: Choose the Protection Tab and Uncheck the Locked
A prompt box will open on your screen under the Protection tab uncheck the Locked option. (Alternatively, you can press Ctrl+1). Click on the OK button.

How to Freeze Cells, Rows, and Columns in Excel
Freezing panes helps keep headers or specific rows and columns visible while scrolling through large datasets. Follow these steps to freeze cells, rows, or columns in Excel:
Step 1: Select the Cell, Row, or Column to Freeze
- To freeze a row: Select the row below the one you want to keep visible.
- To freeze a column: Select the column to the right of the one you want to keep visible.
- To freeze both rows and columns: Click on the cell below the row and to the right of the column you want to freeze.
Step 2: Open the View Tab
- Go to the View tab in the Excel ribbon.
Step 3: Apply the Freeze Panes Option
- Click on Freeze Panes in the Window group.
- Choose one of the following options:
- Freeze Panes: Locks selected rows and columns.
- Freeze Top Row: Locks the first row of the sheet.
- Freeze First Column: Locks the first column of the sheet.
Tips and Best Practices for Cell Lock in Excel Spreadsheet
- Prevent selection of locked cells: While protecting the sheet, uncheck "Select locked cells."
- Add a Lock Cell button: To the Quick Access Toolbar for easier access.
- Use different formatting: For locked cells to distinguish them from editable cells.
- Set a password: To further secure the protected sheet.
These tips not only show how to protect some cells in Excel but also how to protect selected cells in Excel for better data management.
Conclusion
Locking cells in Excel is a must-know skill for anyone sharing or collaborating on spreadsheets. By following this guide, you’ve learned how to lock specific cells, protect entire worksheets, and even lock formulas to prevent accidental changes. You’ve also discovered how to unlock cells when necessary and freeze rows or columns for better visibility.
Now that you know how to lock cells in Excel, you can confidently share your work without worrying about unwanted edits.
Similar Reads
How to Ungroup Columns in Excel: A Complete Guide
Excelâs grouping feature is a powerful tool for organizing complex datasets, but have you ever worked with grouped columns in Excel and needed to break them apart to simplify your view? Ungrouping columns in Excel helps you manage and view your data more efficiently, especially when working with gro
4 min read
How to Make a Calendar in Excel [Complete Guide + Free Templates]
Creating a calendar in Excel is a practical solution for personal and professional scheduling, offering flexibility and customization options. Whether you want to use built-in Excel Calendar 2025 templates or design a dynamic calendar with formulas, PivotTables, or VBA calendar creation, Excel provi
6 min read
How to Create Calculated Columns in Power Pivot in Excel: A Complete Guide
Power Pivot in Excel is a powerful data modelling tool that enables advanced calculations on large datasets. One of its standout features is calculated columns, which allow users to derive new data by applying custom formulas to existing columns. In this article, weâll cover what calculated columns
5 min read
How to Use Goal Seek in Excel with Examples: A Complete Guide
Excel Function Goal Seek : Quick StepsSet Up Your DataGo to Data Tab>>Select What-if-AnalysisFill Out the Goal Seek Dialog BoxRun Goal Seek>>Review the ResultsDo you find yourself stuck trying to solve âwhat-ifâ scenarios in Excel? Whether itâs calculating loan payments, determining sale
9 min read
How to Lock Cells in Google Sheets : Step by Step Guide
Have you ever shared a Google Sheet, only to discover that important data or formulas were accidentally changed? Learning how to lock cells in Google Sheets from editing is essential for maintaining the accuracy and security of your data. Whether youâre looking to protect crucial formulas, set restr
7 min read
How to Create a Form in Excel - A Step by Step Guide
Creating forms in Excel is an efficient way to capture and organize data, whether youâre tracking inventory, collecting survey responses, or entering client information. Excel forms are customizable and easy to use, making data entry faster and more organized, especially when handling large datasets
7 min read
How to Add a Column in Excel: Step-by-Step Guide
Need to organize your data better in Excel but unsure how to add a column without disrupting your existing setup? Whether youâre working with a simple list or a complex table, inserting columns is a fundamental skill that increases productivity and keeps your data structured.This guide covers 4 easy
6 min read
How to Filter in Google Sheets : Complete Guide
How to Add Filters in Google Sheets : Quick StepsOpen Google Sheets>> Select your data range.Go to the Data menu >>Select Create a filterClick the filter icon in any column to sort or filter your data.If you work with large datasets in Google Sheets, using filters is a must to easily man
14 min read
How to Compare Two Columns and Delete Duplicates in Excel?
Many a time while working with Microsoft Excel or MS Excel or Excel, we came up with a situation where we have duplicate values in columns and rows and the first task is to remove all the duplicates before proceeding to the next step. But before removing duplicates, we need to find out where these d
3 min read
XLOOKUP Excel With Examples: Complete Guide
The XLOOKUP function in Excel is a powerful and flexible tool designed to replace older lookup functions like VLOOKUP and HLOOKUP. Unlike these traditional functions, XLOOKUP can search both vertically and horizontally, making it ideal for retrieving specific values from any range in a table. With a
10 min read