Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Lock a Line in Excel: Freeze Rows & Columns

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To lock a line in Excel, you freeze it so it stays visible while you scroll. The quickest way: select the cell just below the row you want to lock (or just to the right of the column), then go to View > Freeze Panes > Freeze Panes. This locks everything above and to the left of your selection. If you only need the top row locked, use View > Freeze Panes > Freeze Top Row. Note that menu labels can differ slightly by Excel version, device, and region.

What You'll Need

  • Microsoft Excel for Windows, Mac, or the web (Excel for the web has limited freeze options; the desktop app is best for full control).
  • A spreadsheet with at least one row or column you want to keep visible.
  • Basic familiarity with selecting cells and using the ribbon.

Step-by-Step

  1. Open your workbook and click the worksheet tab you want to work on.
  2. Decide what to lock. To lock row 1 only, you can use the shortcut below. To lock multiple rows (e.g., rows 1–3), you will select the cell in column A of the row immediately below the last row you want locked. For example, to lock rows 1–3, select cell A4. To lock column A only, select cell B1. To lock both a top row and a left column, select the cell below the row and to the right of the column (e.g., B2 locks row 1 and column A).
  3. Select the cell just below the row(s) and/or just to the right of the column(s) you want to freeze. This cell becomes the anchor point.
  4. Go to the View tab on the ribbon.
  5. Click Freeze Panes in the Window group. A dropdown menu appears.
  6. Choose Freeze Panes from the dropdown. Excel freezes all rows above and all columns to the left of your selected cell.
  7. Verify the lock. Scroll down or right; the frozen rows/columns should stay in place while the rest of the sheet moves. A thin gray line may appear to indicate the freeze boundary.
  8. To lock only the top row without selecting a cell, use View > Freeze Panes > Freeze Top Row. Similarly, Freeze First Column locks column A.
  9. To unlock, go to View > Freeze Panes > Unfreeze Panes. This removes all freezes on the current sheet.

Common Mistakes

  • Selecting the wrong cell. Freezing locks everything above and left of the selection. If you select A1, nothing freezes because there is nothing above or left. Always select the cell just below/right of what you want locked.
  • Expecting freeze to apply to all sheets. Freeze Panes only affects the active worksheet. You must set it separately for each sheet.
  • Confusing freeze with print titles. Freezing affects on-screen scrolling; to repeat rows on printed pages, use Page Layout > Print Titles.
  • Using Excel for the web. The web version has Freeze Panes but fewer options; some advanced freeze features may be missing.
  • Forgetting to unfreeze before editing. Frozen panes can make it harder to select cells near the boundary; unfreeze if you need to rearrange.

Tips

  • Use Freeze Top Row for a quick lock of row 1 without selecting a cell.
  • To lock multiple rows, select the cell in column A of the row below the last row you want frozen. For example, to freeze rows 1–5, select A6.
  • You can freeze both rows and columns by selecting a cell that is below the rows and to the right of the columns you want locked.
  • If you need to lock cells to prevent editing (not scrolling), use sheet protection: Review > Protect Sheet. This is different from freezing panes.
  • On Mac, the View tab and Freeze Panes menu work similarly, but the ribbon layout may differ.
  • Freeze panes are saved with the workbook, so they persist when you reopen the file.

Troubleshooting

  • Freeze Panes is grayed out. This can happen if the worksheet is protected or if you are in cell edit mode. Press Esc to exit edit mode, and unprotect the sheet via Review > Unprotect Sheet if needed.
  • The wrong rows are frozen. Unfreeze via View > Freeze Panes > Unfreeze Panes, then reselect the correct cell and freeze again.
  • Freeze doesn't work on a protected sheet. You must unprotect the sheet first (Review > Unprotect Sheet). Note that unprotecting may require a password.
  • Freeze panes disappear after saving as a different format. Some formats (e.g., .csv) do not support freeze panes. Save as .xlsx to retain them.
  • Excel for the web shows limited freeze options. Use the desktop app for full control; the web version may only offer Freeze Top Row or Freeze First Column.
  • Scrolling still moves the frozen row. Check that you actually applied Freeze Panes (not just selected the row). The menu should show Unfreeze Panes as an option if a freeze is active.

Frequently Asked Questions

Can I freeze more than one row at the top?

Yes. Select the cell in column A of the row immediately below the last row you want frozen. For example, to freeze rows 1–3, select A4, then View > Freeze Panes > Freeze Panes.

Does freezing a row also lock it from editing?

No. Freezing only keeps the row visible while scrolling. To prevent editing, use sheet protection (Review > Protect Sheet).

Why is Freeze Panes grayed out?

Common reasons: the worksheet is protected, you are in cell edit mode, or the workbook is in a view that doesn't support freezing (e.g., Page Layout view). Switch to Normal view and try again.

Can I freeze panes on multiple sheets at once?

No. Freeze Panes applies only to the active worksheet. You must set it individually for each sheet.

What's the difference between Freeze Panes and Split?

Freeze Panes keeps rows/columns visible while scrolling. Split divides the window into separate scrollable panes, which is useful for comparing distant parts of the same sheet.

Does freezing affect printing?

No. Freezing is for on-screen viewing. To repeat rows on printed pages, use Page Layout > Print Titles.