How to Freeze a Line in Excel: Freeze Rows or Columns

How-to basics · Updated November 3, 2026

How to Freeze a Line in Excel: Freeze Rows or Columns

To freeze a line in Excel, open View > Freeze Panes and choose Freeze Top Row or Freeze First Column. To keep several rows or columns visible, select the cell just below and to the right of the area you want to keep, then choose View > Freeze Panes > Freeze Panes. The frozen area stays on screen as you scroll, which is useful for keeping headings or labels in view.

In Excel, a “line” usually means a worksheet row or column rather than a drawn border. The steps below are for Microsoft Excel for Microsoft 365 on Windows. Freeze Panes works on the active worksheet, so first open the sheet where you want the change.

What You’ll Need

  • An Excel workbook with the worksheet you want to work on.
  • A clear idea of which row or column should remain visible while you scroll. For custom freezing, note the first row and column that should scroll.

Step-by-Step

  1. Open the correct worksheet. Click the sheet tab at the bottom of the workbook. Freeze settings apply to the active worksheet, not every sheet in the workbook, so repeat the process on any other sheets that need the same setup.
  2. Choose what needs to stay visible. A heading row at the top is a common choice when a table continues down the screen. A first column is useful when names, product codes, or other identifiers sit to the left of data that extends across the screen. If you need both, or more than one row or column, use the custom selection method below.
  3. Freeze the top row when it contains your headings. Select any cell on the worksheet, then choose View > Freeze Panes > Freeze Top Row. Excel keeps row 1 visible while you scroll vertically. This option freezes only the top row; it does not automatically keep the first column visible.
  4. Freeze the first column when labels run down the left. Choose View > Freeze Panes > Freeze First Column. Column A remains visible as you scroll horizontally. This is a convenient option for a simple list, but it freezes only column A, not a different column or multiple columns.
  5. Select the correct cell for custom freezing. To freeze multiple rows, select the first cell in the row immediately below the rows you want to keep visible. To freeze multiple columns, select the first cell in the column immediately to the right of the columns you want to keep visible. To freeze both, use the cell that is below the rows and to the right of the columns you want fixed.
  6. Apply Freeze Panes to your selection. With the right cell selected, choose View > Freeze Panes > Freeze Panes. Excel freezes the rows above the selected cell and the columns to its left. For example, to keep rows 1 through 3 and columns A and B visible, select C4 before using the command. Rows 4 and below and columns C and to the right will scroll.
  7. Check the result by scrolling. Scroll down to confirm the frozen rows stay at the top, then scroll to the right to check any frozen columns. A thin line on the worksheet marks the boundary between the frozen area and the scrolling area. If the wrong part stays visible, unfreeze the panes and repeat the selection carefully.
  8. Change or remove the freeze when needed. Choose View > Freeze Panes > Unfreeze Panes. Then make a new selection and apply the desired freeze. Excel allows one freeze-pane arrangement per worksheet at a time; you cannot create separate independent frozen sections in different parts of the same sheet.

On Excel for Mac, use the View tab and its Freeze Panes menu; the available top-row, first-column, custom-freeze, and unfreeze choices work on the same principle. Excel for the web also has Freeze Panes options on the View tab, although the menu layout can differ slightly. If you cannot find a command, check that you are in the worksheet view and not editing a cell.

Common Mistakes

Selecting the row you want to freeze instead of the row below it: For custom freezing, Excel looks at the selected cell. It freezes rows above that cell and columns to its left. If you want rows 1 and 2 fixed, select a cell in row 3, not row 2. If you want columns A and B fixed, choose a cell in column C.

Expecting Freeze Top Row to freeze a different heading row: That command always means worksheet row 1. If your headings are in row 5, select a cell in row 6 and choose the general Freeze Panes command instead. Rows above the selected cell will also freeze, so consider whether rows 1 through 4 should remain visible.

Using Freeze Panes to pin a row in the middle of the sheet: Freeze Panes keeps rows above a selection and columns to its left in place. It does not pin an isolated middle row while allowing the rows above it to scroll. If you need to compare distant sections, consider opening another window for the workbook or using a filtered or reorganized view.

Confusing freezing with splitting: Split divides the worksheet window into separate panes that can scroll independently. Freeze Panes instead keeps the specified top rows and left columns fixed while the rest of the sheet scrolls. For ordinary table headings, freezing is usually the simpler choice.

Thinking the thin boundary is a printed line: The divider shows where the frozen area ends on screen. It is not a cell border and is not printed as part of the worksheet. If you need a visible line in a printout, apply a cell border separately.

Tips

Keep the frozen area as small as practical. Freezing a large block can leave little room for the data you are trying to inspect, especially on a laptop screen. For a table with one heading row and a key field in column A, freezing row 1 and column A is often enough. Select B2 and apply Freeze Panes to achieve that combination.

Before choosing the custom command, click the selection box and check its position. The Name Box, to the left of the formula bar, displays the active cell address. If you intend to freeze the top two rows and the first column, for instance, the correct selection is B3: rows 1 and 2 are above it, and column A is to its left.

Use descriptive headings and keep them at the top of the data where possible. Freeze Panes does not turn a range into a table or repeat headings on every printed page; it only affects how the worksheet appears as you scroll. If you need repeated headings on paper, use the print settings for repeating rows instead.

If a worksheet already has a freeze arrangement and you want to change it, unfreeze first. Doing so makes the new selection easier to reason about and prevents you from assuming that Excel will add a second independent frozen area. Save the workbook after arranging the sheet if you want the layout change retained for future sessions.

Troubleshooting

The wrong rows or columns are frozen: Choose View > Freeze Panes > Unfreeze Panes. Click the correct cell, counting from the top row and leftmost column, and reapply Freeze Panes. For example, selecting D5 freezes rows 1 through 4 and columns A through C; it does not freeze row 5 or column D.

The command is unavailable or appears dimmed: Press Enter or Esc to finish editing the active cell, then open the View tab again. Also check whether the workbook is open in a mode or view that limits worksheet commands. If it is in Excel for the web, try the desktop app if the expected option is not available in your current view.

Nothing seems to happen: Try scrolling down or sideways. If the sheet is short or narrow, there may be no scrollable area to reveal the effect. Look for a thin boundary line near the frozen rows or columns. You can also temporarily zoom out or enlarge the worksheet window to make the division easier to see.

The row or column you expected is not at the top or left: Freeze Panes is based on worksheet position, not on a selected table or a heading that appears lower in the sheet. If there are title rows above the table, the custom method freezes all rows above your selected cell, including those titles. To keep only a particular middle row visible is not supported by Freeze Panes; reorganize the data or use another viewing approach.

The freeze does not seem to carry to another sheet: Freeze settings are worksheet-specific. Select the other sheet and set its panes separately. If you switch between sheets often, check each one rather than assuming the setting copied along with the worksheet’s data.

Frequently Asked Questions

Can I freeze more than one row in Excel?
Yes. Select a cell in the row immediately below the last row to keep visible, then choose View > Freeze Panes > Freeze Panes. Selecting A4 freezes rows 1 through 3.

Can I freeze a row and a column at the same time?
Yes. Select the cell below the row or rows and to the right of the column or columns to freeze. For example, select B2 to keep row 1 and column A visible, then apply Freeze Panes.

Can I freeze a row other than the top row?
Yes, if you want that row and all rows above it to remain visible. Select a cell in the row immediately beneath the area to freeze and use the general Freeze Panes command. Excel cannot freeze a single middle row while the rows above it scroll independently.

How do I unfreeze a line in Excel?
On the worksheet, choose View > Freeze Panes > Unfreeze Panes. This removes the current frozen rows and columns; you can then set a different arrangement.

Will frozen rows show up on printed pages?
Freeze Panes controls on-screen scrolling, not print layout. To repeat a heading row on printed pages, use Page Layout > Print Titles and set the rows to repeat at the top.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.