How to Lock Rows in Excel: Freeze and Protect Rows
To lock the top row in Excel, open View > Freeze Panes > Freeze Top Row. To keep several rows visible, select the cell in column A immediately below them, then choose View > Freeze Panes > Freeze Panes.
For example, selecting A4 freezes rows 1 through 3. Those rows remain visible while you scroll through the rest of your worksheet.
There is one distinction worth making before you start. Freezing rows keeps them on screen. Protecting rows prevents changes to their contents. I’ll explain both, starting with keeping your headings visible.
Lock the top row while scrolling
A spreadsheet becomes harder to follow once its column headings disappear. Freezing the first row keeps labels such as Date, Customer, Quantity, and Total above the figures you’re reviewing.
In Excel for Windows:
- Open your worksheet.
- Select the View tab.
- Open Freeze Panes.
- Select Freeze Top Row.
- Scroll down to check that row 1 stays visible.
A dividing line appears below the frozen row. The rows underneath continue scrolling normally.
Freeze Top Row applies to row 1. When your headings sit farther down the worksheet, use the multiple-row method below so the headings remain visible along with the rows above them. Microsoft documents Freeze Panes as the control for keeping worksheet rows and columns visible during scrolling. Microsoft Support
Lock multiple rows in Excel
The easiest way to choose the correct cell is to count one row beyond the last row you want to keep.
Suppose your worksheet contains:
- A report title in row 1.
- A reporting period in row 2.
- Column headings in row 3.
- Your first data entry in row 4.
To keep the title, reporting period, and headings visible, select A4, then apply Freeze Panes.
Follow these steps:
- Return to the top of your worksheet.
- Select A4.
- Open View > Freeze Panes.
- Select Freeze Panes.
- Scroll down several rows.
Rows 1 through 3 should remain at the top while the data below them moves.
I recommend selecting a cell in column A when you only want to freeze rows. Selecting a cell farther to the right can freeze columns as well.
| Rows you want to keep visible | Cell to select before applying Freeze Panes |
|---|---|
| Row 1 | A2 |
| Rows 1–2 | A3 |
| Rows 1–3 | A4 |
| Rows 1–5 | A6 |
| Rows 1–10 | A11 |
The selection marks the boundary. Excel freezes the rows above that cell and the columns to its left.
Keep rows and columns visible together
A wide spreadsheet often needs both its headings and its identifying column to stay visible.
For example, a sales report might have product names in column A and monthly figures across the remaining columns. Freezing only the headings still allows the product names to disappear when you scroll sideways.
To keep row 1 and column A visible:
- Select B2.
- Open View > Freeze Panes.
- Select Freeze Panes.
- Scroll down, then sideways, to check both boundaries.
For a report with headings across the first three rows and identifiers in the first two columns, select C4 instead.
Think of the selected cell as the first cell in the area that should remain free to scroll. The rows above it and the columns to its left stay in place.
Can you freeze a row in the middle of a worksheet?
You cannot use Freeze Panes to pin an isolated middle row while allowing all the rows above it to scroll away.
For example, freezing above A8 keeps rows 1 through 7 in place. It does not freeze row 7 on its own. Excel’s frozen area starts from the top row or the first column. Microsoft Support
When your main headings are far down the sheet, consider moving them nearer the top. Large frozen areas leave less room for the data you actually need to review, especially on a laptop screen.
You also cannot create separate frozen groups such as rows 1–2 and rows 15–16 using Freeze Panes.
Change or remove your frozen rows
To remove the freeze:
- Open View.
- Select Freeze Panes.
- Choose Unfreeze Panes.

Your rows and columns will scroll normally again.
To change from one frozen row to three, unfreeze the existing arrangement first. Then select A4 and apply Freeze Panes again.
This is also the first correction I recommend when Excel freezes more of the worksheet than you intended. Start with a fresh boundary instead of trying to adjust the existing one.
Why the wrong rows or columns stay visible
Most unexpected results come from the selected cell or the menu option used.
You selected the last heading row
Suppose your headings end in row 3. Selecting A3 freezes only the rows above it, leaving row 3 in the scrolling area.
Select A4 to include row 3.
You chose Freeze Top Row for a multirow heading
Freeze Top Row keeps just the first row visible. For a title, subtitle, and heading across three rows, use A4 > View > Freeze Panes > Freeze Panes.
Columns are frozen as well
Selecting D4 sets a boundary below row 3 and to the right of column C.
To freeze those rows without freezing columns, unfreeze the sheet and select A4 before applying the setting again.
The frozen area takes up most of the screen
Freezing a large introductory section can leave only a few visible rows for scrolling.
Unfreeze the worksheet and keep only the essential headings at the top. Reducing the number of frozen rows usually makes the sheet easier to navigate than shrinking everything with the zoom control.
How to lock rows against editing
Freezing does not stop someone from changing a heading, deleting a value, or overwriting a formula.
To prevent changes, use cell locking together with Protect Sheet. Excel cells are marked Locked by default, but that setting takes effect when worksheet protection is enabled. Microsoft Support
Here is how to protect rows 1 through 3 while leaving the rest of the worksheet editable in desktop Excel.
First, unlock the worksheet’s cells
- Save your workbook.
- If the sheet is already protected, select Review > Unprotect Sheet and enter its password if required.
- Click the Select All triangle where the row numbers and column letters meet.
- Right-click the selected area and choose Format Cells.
- Open the Protection tab.
- Clear Locked, then select OK.
This prepares the rest of the worksheet to remain editable.
Then lock the rows you want to protect
- Select row headers 1 through 3.
- Right-click the selection and choose Format Cells.
- Open Protection.
- Select Locked, then select OK.
- Open Review > Protect Sheet.
- Review the actions you want to allow.
- Enter an optional password and confirm it if prompted.

Test the result by trying to edit a heading and an ordinary data cell. The heading should resist changes while the unlocked data cell remains editable. Microsoft describes this as a two-stage process: establish which cells remain editable, then protect the worksheet. Microsoft Support
Keep any protection password somewhere you can retrieve it. Also, worksheet protection controls editing; it does not encrypt the file or prevent someone from reading its contents. Microsoft Support
Locking rows in Excel for Mac
The same selection rule applies on a Mac.
To keep the first three rows visible, select A4, open View, and choose Freeze Panes. To keep the first row and first column visible together, select B2 before applying the command.
To remove the setting, choose View > Unfreeze Panes. The arrangement of buttons can differ from Windows, but the boundary remains above and to the left of your selected cell.
Can you freeze and protect the same rows?

Yes. The two features serve different purposes and can be used together.
For a shared report, I would freeze the headings to keep them visible, then protect those heading cells while leaving the intended data-entry cells unlocked. Check both results before sharing: scroll to verify the headings stay in view, then try editing a heading and a data cell to confirm that the protection behaves as intended.