How to lock a column in excel
Tutor 5 (70 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To lock a column in Excel, you need to protect the worksheet after unlocking all cells except the column you want to lock. Excel locks all cells by default when you apply worksheet protection, so you must unlock the cells you want to remain editable first.
Steps to Lock a Column
1. Select All Cells
Click the triangle button at the intersection of the row and column headers (top-left corner of the worksheet) to select all cells.
Windows: Press Ctrl + A Mac: Press Command + A
2. Unlock All Cells
Right-click the selected cells and choose "Format Cells" from the context menu.
Navigate to the "Protection" tab in the Format Cells dialog box.
Uncheck the "Locked" checkbox.
Click "OK" to apply the changes.
3. Select the Column to Lock
Click the column header letter (such as A, B, or C) to select the entire column you want to lock.
You can select multiple non-adjacent columns by holding Ctrl (Windows) or Command (Mac) while clicking additional column headers.
4. Lock the Selected Column
Right-click the selected column and choose "Format Cells."
Go to the "Protection" tab.
Check the "Locked" checkbox.
Click "OK."
5. Protect the Worksheet
Windows: Navigate to the "Review" tab on the ribbon and click "Protect Sheet." Mac: Navigate to the "Review" tab on the ribbon and click "Protect Sheet."
The "Protect Sheet" dialog box appears with options to customize protection settings.
6. Configure Protection Options
Check "Protect worksheet and contents of locked cells" at the top of the dialog box.
Enter a password in the "Password to unprotect sheet" field (optional but recommended).
Select the actions you want to allow users to perform from the checklist. Common options include:
- Select locked cells
- Select unlocked cells
- Format cells
- Insert columns
- Delete columns
7. Confirm Protection
Click "OK" to apply worksheet protection.
Confirm your password by re-entering it in the confirmation dialog box (appears only when you set a password).
Click "OK" again.
What Happens After Locking a Column
Users cannot edit, delete, or modify the locked column when worksheet protection is active.
Users can still edit unlocked cells normally.
Attempting to edit a locked cell displays an error message stating the cell is protected.
How to Unlock a Column
1. Unprotect the Worksheet
Navigate to the "Review" tab and click "Unprotect Sheet."
Enter the password when prompted (required only when you set a password during protection).
2. Modify Cell Lock Settings
Select the column you want to unlock.
Right-click and choose "Format Cells."
Go to the "Protection" tab and uncheck "Locked."
Click "OK."
3. Reprotect the Worksheet
Follow steps 5-7 from the locking process to reapply worksheet protection with your updated settings.
Can You Lock a Column Without Protecting the Sheet?
No, you cannot lock a column without protecting the sheet. The "Locked" cell property only takes effect when you activate worksheet protection. Checking the "Locked" option in Format Cells has no impact until you protect the worksheet through the Review tab.
How to Lock a Column with a Formula
Locking columns containing formulas follows the same process as locking any other column. The formula remains functional after locking, but users cannot modify or delete it when protection is active.
1. Select the column containing formulas.
2. Right-click and choose "Format Cells."
3. Check "Locked" in the Protection tab.
4. Protect the worksheet using the Review tab.
Consider checking the "Hidden" checkbox in the Protection tab to prevent users from viewing the formula in the formula bar. This option protects proprietary calculations or sensitive logic from being visible.
How to Lock Multiple Columns
1. Select Multiple Columns
Adjacent columns: Click the first column header, hold Shift, and click the last column header.
Non-adjacent columns: Click the first column header, hold Ctrl (Windows) or Command (Mac), and click additional column headers.
2. Apply Lock Settings
Right-click the selection and choose "Format Cells."
Check "Locked" in the Protection tab.
Click "OK."
3. Protect the Worksheet
Follow the standard worksheet protection process from the Review tab.
Limitations of Column Locking
Worksheet protection provides basic security but does not encrypt data. Advanced users can bypass worksheet protection using third-party tools or VBA macros.
Protecting the workbook structure (different from worksheet protection) prevents users from adding, deleting, or renaming sheets but does not lock columns within sheets.
You cannot lock columns for specific users while allowing others to edit them without using shared workbook features or Excel Online's co-authoring permissions.
Locked columns prevent all editing actions, including formatting changes, unless you specifically allow these actions in the "Protect Sheet" dialog box.
How to Allow Specific Actions on Locked Columns
The "Protect Sheet" dialog box contains checkboxes that permit specific actions even when cells are locked:
Format cells: Allows users to change fonts, colors, and number formats without modifying cell values.
Format columns: Permits adjusting column width and hiding/unhiding columns.
Sort: Enables sorting data ranges that include locked cells.
Use AutoFilter: Allows filtering data without editing cell contents.
Check the appropriate boxes based on your requirements before clicking "OK" to activate protection.
How to Lock Columns in Excel Online
Excel Online provides limited protection features compared to the desktop version.
1. Open the workbook in Excel Online.
2. Navigate to the "Review" tab.
3. Click "Protect Sheet."
4. Configure the protection settings in the task pane that appears on the right side.
5. Choose which cells to protect (you can select ranges, but column-specific protection requires selecting the entire column range).
6. Set permissions for who can edit the protected areas.
Excel Online does not support the detailed "Protect Sheet" dialog options available in desktop Excel. The online version focuses on range-based protection with user-specific editing permissions.
Password Best Practices
Use passwords containing at least 8 characters with a mix of uppercase letters, lowercase letters, numbers, and symbols.
Store passwords in a secure password manager rather than writing them down.
Excel passwords are case-sensitive, so "Password123" differs from "password123."
Document your passwords in a secure location because Excel does not provide password recovery options. Forgetting the password requires third-party tools to regain access.
Change passwords periodically when multiple users have access to the protected workbook.
Difference Between Locking Cells and Protecting Sheets
Locking cells marks specific cells as protected but has no effect until you activate worksheet protection. All cells have the "Locked" property enabled by default.
Protecting sheets activates the lock settings and enforces restrictions on locked cells. Protection applies to the entire worksheet and controls which actions users can perform.
You must configure both settings to successfully lock columns: set the "Locked" property on specific cells, then activate worksheet protection to enforce those settings.
How to Lock a Column in a Shared Workbook
Shared workbooks have limited protection features compared to standard workbooks.
1. Unshare the workbook temporarily:
- Navigate to the "Review" tab
- Click "Share Workbook"
- Uncheck "Allow changes by more than one user at the same time"
- Click "OK"
2. Apply column locking using the standard process.
3. Protect the worksheet.
4. Reshare the workbook if needed.
Worksheet protection remains active in shared workbooks, but some features become unavailable when sharing is enabled. Consider using Excel Online's co-authoring features for better control over user permissions in collaborative environments.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to add secondary axis in excel
Answers · 1
How to switch columns to rows in excel
Answers · 1
How to subtract on excel
Answers · 1
How to combine two cells of text in excel
Answers · 1