Nothing’s worse than accidentally deleting a header row or watching a colleague overwrite critical formulas. If you’ve ever had that stomach-dropping moment when you realized someone changed your carefully organized spreadsheet, you know exactly why how to lock row in Excel matters. Freezing rows—or protecting them entirely—is one of those skills that separates organized teams from chaotic ones.
The good news? Learning how to lock row in Excel takes about five minutes, and it’ll save you hours of frustration down the road. Whether you want to freeze header rows so they stay visible while scrolling, or lock rows to prevent accidental edits, Excel gives you multiple ways to do it. Let’s walk through each method so you can pick the right one for your situation.
Freeze Panes: Keep Headers Visible While Scrolling
Here’s the reality: how to lock row in Excel usually means one of two things. First, there’s freezing rows, which keeps them visible on screen while you scroll down through data. This is the most common use case, and it’s ridiculously simple.
Think of freezing like putting a glass panel between your header row and your data. You can scroll through thousands of rows below, but that header stays put at the top.
Here’s how to freeze the top row:
- Open your spreadsheet in Excel
- Click on Row 2 (the row directly below the one you want to freeze)
- Go to the View tab in the ribbon
- Click Freeze Panes
- Select Freeze Panes from the dropdown
Done. Your top row is now frozen. Scroll down and watch it stay locked at the top. It’s that straightforward.
What if you want to freeze multiple rows? Same process, but click on the row number of the first row you don’t want frozen. If you want rows 1-3 frozen, click on row 4, then freeze panes. Excel will lock everything above that row.
Pro Tip: You can also freeze columns the same way. Click on the column to the right of what you want frozen, then use Freeze Panes. Or freeze both rows and columns at once by clicking on a specific cell (e.g., cell B2 to freeze row 1 and column A).
The beauty of freezing is that it’s visual only. It doesn’t prevent anyone from editing those rows—it just keeps them visible. If you need actual protection, that’s a different beast entirely.
Lock Specific Rows to Prevent Edits
Now we’re getting into the real how to lock row in Excel territory. If you want to prevent people from editing a row, you need to protect your sheet. This is where most people get confused, so pay attention.
Here’s the thing: Excel’s protection system works backwards from what you’d think. By default, all cells are marked as “locked,” but that lock only activates when you protect the sheet. So the workflow is:
- Select the rows you want to protect
- Mark them as locked (they usually already are)
- Protect the sheet
- Excel will prevent edits to locked cells
Step-by-step to lock specific rows:
- Click on the row number of the first row you want to lock (e.g., row 1)
- Hold Ctrl and click additional row numbers to select multiple rows
- Right-click and choose Format Cells
- Go to the Protection tab
- Make sure “Locked” is checked (it should be by default)
- Click OK
- Now go to Review tab → Protect Sheet
- Choose your options and click OK
Your rows are now protected. Try editing them—you’ll get a “cell is protected” message. Only users with the password (if you set one) can edit those cells.
Safety Warning: If you want to lock some rows but allow editing in others, you need to reverse the process. Unlock the cells you want people to edit, then protect the sheet. This way, only the locked cells are protected.
This is where how to create a dropdown in Excel comes in handy—you can create data validation dropdowns in unprotected cells while keeping critical formulas locked.
Unlock Cells Selectively
Here’s a practical scenario: You have a budget spreadsheet. The formulas in column B are sacred—nobody should touch them. But column C is for actual spending data, and your team needs to update it constantly. How do you lock column B but leave column C editable?
You unlock the cells you want people to edit.
Here’s the process:
- Select the cells or rows you want to remain editable (e.g., column C, rows 2-50)
- Right-click → Format Cells
- Go to Protection tab
- Uncheck the “Locked” box
- Click OK
- Now protect your sheet (Review → Protect Sheet)
Now when the sheet is protected, only the unlocked cells can be edited. Everything else—including your header rows and formula columns—stays locked.
This is the real way to use how to lock row in Excel effectively. Most people just lock everything and call it a day, but selective locking is where the power is.
Protect Your Entire Sheet

Sometimes you want to lock down the whole thing. Maybe you’re sharing a template and don’t want anyone messing with your structure. Or you’ve got a dashboard that took hours to build, and you want it read-only.
To protect an entire sheet:
- Go to Review tab
- Click Protect Sheet
- You’ll see options for what users can do (insert rows, format cells, etc.)
- Optionally, enter a password
- Click OK
That’s it. The entire sheet is now locked. Users can view and scroll, but they can’t edit, insert rows, or delete columns—depending on which permissions you allowed.
According to Microsoft’s official documentation on worksheet protection, you can customize exactly which actions are allowed. Want people to be able to insert rows but not delete them? You can do that.
Real Talk: Sheet protection in Excel is not military-grade security. It’s more of a “please don’t accidentally break this” feature. If someone really wants to get past it, they can. For sensitive data, use stronger methods like file encryption or cloud storage permissions.
Common Mistakes When Locking Rows
I’ve seen this a hundred times. Someone locks their entire sheet, then wonders why their team can’t input data. Let me save you the headache.
Mistake #1: Protecting the sheet without unlocking editable cells first. You lock everything, then protect. Result: nothing is editable. Solution: unlock the cells you want people to edit before protecting the sheet.
Mistake #2: Forgetting to protect the sheet after locking cells. You lock rows and format cells, but you never hit “Protect Sheet.” Guess what? The locks don’t do anything. They only work once the sheet is protected.
Mistake #3: Locking when you meant to freeze. You want to keep headers visible while scrolling, so you lock the row. But now nobody can edit it. You wanted Freeze Panes, not cell protection. Different tools, different jobs.
Mistake #4: Using the same password for everything. If you protect your sheet with a password, use a unique one. Don’t use your email password or your company password. It’s just asking for trouble.
Mistake #5: Not testing it first. Before you share a protected sheet, test it yourself. Try to edit a locked cell. Try to edit an unlocked cell. Make sure it works the way you expect. Nothing worse than sending out a “protected” spreadsheet that’s actually wide open.
This is especially important if you’re merging cells in Excel—merged cells and protection can interact in weird ways. Test it thoroughly.
Adding Password Protection
Want to take it a step further? Add a password so people can’t just unprotect the sheet themselves.
Here’s how:
- Go to Review → Protect Sheet
- Check the box for “Protect sheet and contents when file is opened”
- In the password field, enter a strong password (mix of letters, numbers, symbols)
- Confirm the password
- Click OK
Now, when someone tries to unprotect the sheet, they’ll need your password. Without it, they can’t modify the protection settings.
Password tips:
- Use at least 8 characters
- Mix uppercase, lowercase, numbers, and symbols
- Avoid using the same password you use elsewhere
- Write it down somewhere safe (or use a password manager)
- Don’t share it via email or chat—use a secure method
If you forget the password, Microsoft won’t help you recover it. You’ll have to create a new file. So write it down.
Pro Tip: If you’re sharing a file with a team, consider using a shared password that everyone knows, stored in your team’s password manager. This way, people can unprotect if needed, but casual edits are prevented.
Troubleshooting Locked Rows
Something not working? Here are the most common issues and fixes.
“The cells still aren’t locked even though I protected the sheet.” Make sure the cells are actually marked as locked. Right-click → Format Cells → Protection tab. Check the “Locked” box. Then protect the sheet.
“I can’t unprotect the sheet.” If you set a password, you need it to unprotect. If you forgot the password, you’re stuck. The only workaround is to copy all your data to a new sheet and recreate the structure (tedious, but it works).
“Some cells are locked but others aren’t, and I can’t remember which is which.” Go to Home → Find & Select → Go To Special. Look for “Locked” cells. This will highlight all locked cells so you can see what’s protected.
“I froze panes but now I can’t scroll to see the frozen rows.” You can’t scroll past frozen rows—that’s the whole point. If you want to see them, unfreeze (View → Freeze Panes → Unfreeze Panes) or scroll back to the top.
“I protected the sheet but people can still delete rows.” When you protect the sheet, you can choose which actions are allowed. Go to Review → Protect Sheet and uncheck “Delete Rows” if you don’t want people deleting them.
For more complex protection scenarios, Family Handyman’s guide to protecting documents (while focused on physical documents) has good principles about layered protection that apply to digital files too.
Frequently Asked Questions
What’s the difference between freezing and locking rows in Excel?
– Freezing keeps rows visible while you scroll—it’s purely visual. Locking prevents edits to specific cells. You can freeze a row and still edit it. You can lock a row and still scroll past it. They’re different tools for different jobs. Use Freeze Panes if you want headers visible. Use cell protection if you want to prevent edits.
Can I lock rows in Excel without protecting the entire sheet?
– No. Locking cells only works when the sheet is protected. You can mark cells as “locked,” but until you protect the sheet, they’re editable. It’s a two-step process: mark cells as locked, then protect the sheet.
What happens if I forget my sheet protection password?
– You’re stuck. Microsoft doesn’t provide password recovery for sheet protection. Your options are: copy your data to a new sheet (losing the protection), or ask whoever set the password. This is why you should store passwords securely and test protection before sharing files.
Can I protect some sheets but not others in the same workbook?
– Yes. Each sheet can have its own protection settings. Protect Sheet 1, leave Sheet 2 unprotected. Users will be able to edit Sheet 2 but not Sheet 1. This is useful for templates where some sheets are for input and others are for calculations.
How do I know which cells are locked?
– Go to Home → Find & Select → Go To Special and look for “Locked” cells. Excel will highlight all locked cells. Or right-click a cell → Format Cells → Protection tab to check if that specific cell is locked.
Can I lock rows in Google Sheets the same way?
– Google Sheets has similar features but different names. You can “freeze” rows (Data → Freeze), and you can “protect” sheets or ranges (Data → Protect Sheets and Ranges). The concept is the same, but the menus are different. If you’re switching between Excel and Google Sheets, expect a learning curve.
What if I want to allow some people to edit locked cells?
– Sheet protection is all-or-nothing in Excel. Either someone can unprotect the sheet (with the password) and edit everything, or they can’t. If you need granular permissions (User A can edit this range, User B can edit that range), you need a different solution—like using Excel’s cloud features or a third-party tool. Bob Vila’s guide to spreadsheet software compares tools with more advanced permission controls.
Can I lock rows in Excel on Mac?
– Yes. The process is the same. Go to View → Freeze Panes to freeze rows, or Review → Protect Sheet to lock cells. The menus look slightly different on Mac, but the functionality is identical.

Is there a way to lock rows without a password?
– Yes. When you protect the sheet, the password field is optional. You can protect without setting a password, and users will be able to unprotect the sheet themselves. Use this if you just want to prevent accidental edits, not intentional ones.
What’s the best way to share a protected spreadsheet with a team?
– If you set a password, share it through a secure channel (your company’s password manager, a secure message, not email). Make sure everyone knows which cells are editable and which are locked. Test it yourself first to make sure it works as expected. Consider leaving a comment in the file explaining the protection setup.




