How to Lock a Row in Excel: A Practical Guide
Learn to lock a row in Excel to prevent edits while keeping other cells editable. This practical guide covers sheet protection, cell locking, real-world examples, common pitfalls, and security best practices.

By protecting a worksheet and using the Locked attribute for cells, you can secure a specific row in Excel while leaving other rows editable. This involves two steps: first unlock the rows you want editable, then lock the target row and apply sheet protection with optional password. The result prevents edits to the locked row while preserving collaboration elsewhere.
Understanding Locking in Excel
In many business spreadsheets, locking rows is essential to preserve critical data while allowing others to contribute where appropriate. Excel protects edits via two complementary mechanisms: the cell-level Locked property and worksheet protection. By default, all cells are locked, but this lock is only enforced when you enable sheet protection. According to XLS Library, the idea is to separate a row or region you want shielded from the rest of the sheet, then enable protection to enforce those rules. This separation is especially important in shared workbooks where multiple users update data, suppliers, budgets, or schedules. When you understand how locks interact with protection, you can design robust templates that reduce errors without slowing down collaboration. The practical takeaway is simple: plan which rows must be immutable, set their cells to Locked, unlock everything you want editable, and then apply sheet protection.
Why this matters for collaboration
Locking specific rows helps prevent accidental edits in critical areas like totals, formulas, or approval rows. It also reduces the risk of breaking formulas that span those rows. By clearly delineating protected and editable regions, you create a predictable workflow for teammates and stakeholders. In terms of governance, protected sheets can be shared with confidence, knowing that sensitive sections remain intact. The XLS Library team emphasizes that protection is not a security mechanism for sensitive data, but a safeguard for workbook integrity and teamwork.
Key concepts you’ll use
- Locked property: Determines whether a cell can be edited when the sheet is protected.
- Protect Sheet: Enables enforcement of the Locked settings and other restrictions.
- Unprotecting: Allows you to make changes later; password-protected sheets add an extra layer of control.
Understanding these concepts helps you tailor protection to your needs, whether you’re guarding a single row, an entire column, or an entire worksheet. In practice, you’ll often start by locking everything, then unlocking only the rows you want editable, and finally applying protection to lock the rest. This approach gives you precise control over what teammates can and cannot modify.
The role of passwords and collaboration
A password on sheet protection prevents casual edits, but is not a substitute for secure data handling. If you forget the password, editing locked regions becomes difficult. Consider using a shared vault or password manager for teams and keep a documented recovery process. For sensitive data, combine sheet protection with workbook-level measures and access controls to minimize risk while preserving productivity.
Real-world context: when to lock or unlock rows
Many budgets, project plans, and compliance checklists rely on a few immutable rows—like final approvals, date stamps, or reference numbers. Locking these rows preserves the integrity of essential data while allowing staff to continue updating supporting information. The decision to lock should align with your team’s workflow and review procedures. By documenting which rows are locked and which are editable, you help new team members onboard quickly and avoid accidental edits.
How to think about variants across Excel environments
The core idea of locking a row remains the same on Windows and macOS, but the UI may look different. On some versions, you’ll access protection through the Review tab; on others, it might be under the Protect group. Keyboard shortcuts can speed up the process, though the exact keys vary between platforms. Regardless of your environment, the same principle applies: designate the protected rows, protect the sheet, test edits, and refine as needed. The goal is a reliable, repeatable workflow that reduces mistakes and supports collaboration.
Tools & Materials
- Excel workbook (Windows or Mac)(Any modern Excel version (365, 2021, 2019))
- Backup copy of the workbook(Before applying protection)
- Password (optional)(If you want password protection)
- Mouse/trackpad and keyboard(For navigation and editing)
- Clear labeling (row identifiers)(Helps teammates know which rows are locked)
Steps
Estimated time: 8-12 minutes
- 1
Open the workbook and locate the target row
Open the worksheet that contains the row you want to lock. Identify the exact row number and ensure it contains the data you want protected. If you have multiple rows to protect, note them clearly for the next steps.
Tip: Tip: Use Ctrl+Arrow keys to jump to the edge of your data for faster navigation. - 2
Unlock the rows you want editable
Select all rows that should remain editable and press the Locked toggle to unlock them. By default, Excel locks all cells when protection is applied, so you must explicitly unlock the editable area first.
Tip: Pro tip: Lock everything first, then unlock the specific rows you want editable for a clean, reliable setup. - 3
Lock the target row cells
Select the cells in the row you want to lock, and set them to Locked. This ensures only the chosen row becomes immutable once protection is active.
Tip: Pro tip: Check formulas in that row to ensure protection does not inadvertently break references. - 4
Protect the worksheet
Go to Review > Protect Sheet (or the equivalent in your version) and enable protection. Choose whether to require a password and which actions (select locked/unlocked cells, format cells, etc.) are allowed.
Tip: Pro tip: Start with no password to test, then add a password once you’re confident the setup works as intended. - 5
Save and test the protection
Save the workbook, then try to edit the locked row. If edits are blocked and unlocked sections still accept changes, the protection is correctly configured.
Tip: Pro tip: Have a colleague try editing the locked row to verify the setup across user accounts. - 6
Document and share the editing rules
Record which rows are locked, which are editable, and the password policy if used. Distribute clear guidelines to teammates to reduce confusion.
Tip: Pro tip: Create a short one-page 'Editing Rules' sheet within the workbook for quick reference.
People Also Ask
How do I unlock a row after protection is enabled?
To unlock a row, first unprotect the sheet (no password or the required password). Then select the cells in the row and change the Locked property to false. Finally, re-apply protection if needed.
Unprotect the sheet, unlock the desired row's cells, and re-protect the sheet if you want to keep edits elsewhere locked.
Can I lock multiple non-adjacent rows at once?
Yes. Select each non-adjacent row range while holding Ctrl, unlock those rows, then lock the specific rows you want protected and enable sheet protection.
You can lock several non-adjacent rows by selecting them while editing, unlocking the editable parts, then applying protection.
Does locking a row prevent copying the data?
Locking prevents edits within the row when protection is active. Users can still copy the data if they copy from the worksheet, so consider data export controls if needed.
Locking stops edits, but it doesn't fully prevent copying; for sensitive data, use broader access controls.
Is sheet protection the same on Mac and Windows?
The basic concepts are the same, though the menu paths and layout differ slightly between Windows and macOS versions of Excel.
The approach is the same across platforms, with minor UI differences.
What happens if I forget the password for a protected sheet?
If you forget the password, editing locked cells becomes very difficult. Use a password manager and maintain a recovery process for team protections.
Without the password, you may be locked out of editing; store passwords securely.
Can I protect only certain actions (like editing formulas) while keeping other edits allowed?
Yes. When you protect a sheet, you can tune which actions are allowed (formatting, inserting rows, etc.). This gives granular control over what collaborators can do.
You can customize protections to allow or disallow specific actions.
What should I do if a row with formulas stops calculating after protection?
Check that the cells containing formulas are set to Locked or Unlocked appropriately and verify that cells referred to by formulas are accessible under your protection settings.
Inspect locked/unlocked status and the protection options affecting formula cells.
Are there alternatives to sheet protection for critical data?
Yes. Consider shared workbooks with version control, restricted access via file permissions, or moving sensitive calculations to a separate, secured workbook.
Protection is one layer; for sensitive data, use multiple layers like file permissions and version control.
Watch Video
The Essentials
- Define which rows must be locked before protection.
- Unlock editable regions, then apply sheet protection.
- Test thoroughly with real edits and collaborators.
- Document rules and password handling for teams.
- Protection is a safeguard for workflow, not a security perimeter.
