To pin a row in Excel, open the View tab, select Freeze Panes and choose Freeze Top Row. With the sheet scrolled to the top, row 1 stays on screen while the rest of the sheet scrolls. To keep more rows, or rows and columns together, select the cell just below the last row and just right of the last column you want to keep, then choose View > Freeze Panes > Freeze Panes. Excel calls this freezing, not pinning, so look for Freeze on the ribbon.
Press Ctrl + Home before you freeze anything. When we froze while scrolled down to row 41, Excel froze the rows on screen instead of the top of the sheet, and rows 1 to 40 could not be scrolled back into view until we unfroze. Freeze Top Row did the same and pinned row 41.
The short version
- Top row: press Ctrl + Home, then choose View > Freeze Panes > Freeze Top Row.
- More rows or columns: select the cell just below and right of them, then View > Freeze Panes > Freeze Panes.
- Excel for the web: View > Freeze Panes, then Top Row, First Column or Freeze at selection.
- Keyboard: press Alt, W, F, then F, R or C, one key at a time.
- Remove it: View > Freeze Panes > Unfreeze Panes. Ctrl + Z does not undo a freeze.
- Printing: frozen rows are not repeated on every printed page. Use Page Layout > Print Titles for that.
Pin the top row in Excel
Freeze Top Row is the quickest way to keep a header row on screen. Press Ctrl + Home so that row 1 is the top row in view. Then select the View tab and, in the Window group, select Freeze Panes. A menu opens with three commands, each with a short description under its name.
Select Freeze Top Row. A thin line appears under row 1, and as you scroll, row 1 stays where it is while the other rows slide under it. On our PC the row numbers then read 1, 142, 143 and so on, which is the easiest way to see that a freeze is on.
The description under the command says the same thing in Excel's words: "Keep the top row visible while scrolling through the rest of the worksheet". If you have not used the ribbon much, our beginner's guide to Excel shows where the tabs are and what each one holds.
Freeze the first column
To keep column A in view while you scroll to the right, press Ctrl + Home, then choose View > Freeze Panes > Freeze First Column. A line appears to the right of column A. When we scrolled right, column A stayed put and the next column on screen was P.
You cannot stack the two quick commands. Freeze Top Row and Freeze First Column replace each other, so when we chose one and then the other, only the second stayed frozen, in either order. To hold row 1 and column A together, select cell B2 and choose Freeze Panes instead.
Which cell to select before you freeze
Freeze Panes works from the cell you select. Microsoft puts the rule in one line: "Freeze Panes freezes the rows above and the columns left of the selected cell". Select C3, and rows 1 and 2 stay on screen along with columns A and B.
Selecting a whole row or column works the same way. When we clicked the row heading 3, Excel froze rows 1 and 2, exactly as it did with only cell A3 selected. Clicking the column heading C froze columns A and B.
Do not leave A1 selected. There are no rows above A1 and no columns to its left, and on our PC Freeze Panes then froze at roughly the middle of the window instead, rows 1 to 11 and columns A to H in one try, and moved the selection there. The same happened when the selected cell had been scrolled out of view.
The table covers the usual cases. The keys in the last column are Key Tips, pressed one at a time, which the keyboard section explains.
| What should stay on screen | Select this first | Then choose | Keys on Windows |
|---|---|---|---|
| Row 1 | Any cell, after Ctrl + Home | Freeze Top Row | Alt, W, F, R |
| Column A | Any cell, after Ctrl + Home | Freeze First Column | Alt, W, F, C |
| Rows 1 to 3 | Row 4, or cell A4 | Freeze Panes | Alt, W, F, F |
| Columns A and B | Column C, or cell C1 | Freeze Panes | Alt, W, F, F |
| Row 1 and column A | Cell B2 | Freeze Panes | Alt, W, F, F |
| Rows 1 and 2 with columns A and B | Cell C3 | Freeze Panes | Alt, W, F, F |
| Nothing, to remove the freeze | Any cell | Unfreeze Panes | Alt, W, F, F |
Freeze several rows, columns or both
To keep the first two rows, select row 3 or cell A3 and choose View > Freeze Panes > Freeze Panes. For the first two columns, select column C. For both at once, select C3.
Our sheet had a header row and a target row at the top and customer names in column A. With C3 selected, Freeze Panes drew one line under row 2 and another to the right of column B. Both held as we scrolled down to row 143 and across to column Q.
With the sheet scrolled to the top left, a freeze starts at row 1 and column A, and the next section shows what happens to rows when it is not. Microsoft's Mac instructions say you can freeze as many rows and columns as you want, as long as you always start with the top row and the first column. If the column you need sits further right, drag the column next to column A first, then freeze.
Frozen rows are not locked. We typed a new value into a cell in the frozen target row and Excel took it at once, so a freeze only changes what you see.
Scroll to the top before you freeze
Excel freezes what is on screen above the selected cell, not everything above it in the sheet. That matters as soon as you have scrolled. We scrolled until row 41 was the top row, selected A46 and chose Freeze Panes, and Excel froze rows 41 to 45.
After that the mouse wheel would not go above row 41. Ctrl + Home, which normally jumps to A1, went to A46, the first cell below the frozen rows. Rows 1 to 40 stayed out of reach until we chose Unfreeze Panes.
Freeze Top Row has the same catch, even though its name says top row. With row 41 at the top of the window, it froze row 41 and left rows 1 to 40 unreachable. The fix for both is the same: unfreeze, press Ctrl + Home, select the right cell and freeze again.
Unfreeze rows and columns
To remove a freeze, choose View > Freeze Panes > Unfreeze Panes. While a freeze is on, Unfreeze Panes takes the place of Freeze Panes at the top of the menu, described as "Unlock all rows and columns to scroll through the entire worksheet".
To move a freeze, unfreeze first, then select the new cell and choose Freeze Panes. Freeze Top Row and Freeze First Column stay on the menu while a freeze is on, and choosing either of them replaces the freeze you have.
Ctrl + Z does not remove a freeze. It undoes your last edit instead, even one on another sheet, as it did for us: right after we froze the panes, the Undo button's tooltip named the edit before it, and Ctrl + Z switched sheets to undo that edit while the freeze stayed on. Pressing Ctrl + Y brought our edit back. To remove the freeze, use View > Freeze Panes > Unfreeze Panes.
Freeze panes with the keyboard
Excel has no single shortcut for freezing, but the ribbon's Key Tips get you there in four presses. Press and release Alt, and a letter appears under each tab, with W on View. Press W, and F appears on Freeze Panes.
Press F to open the menu, then F for Freeze Panes, R for Freeze Top Row or C for Freeze First Column. With a freeze already on, Alt, W, F, F unfreezes instead, because Unfreeze Panes takes the first slot and its letter. Our list of the best Excel keyboard shortcuts covers the other ones worth learning.
You can also find the commands by name. Press Alt + Q to jump to the Search box at the top of the window and type freeze. On our PC the list offered Freeze Panes, Freeze Top Row and Freeze First Column directly under Actions.
Freeze rows in Excel for the web
In Excel for the web, select View > Freeze Panes. The menu uses shorter names than the desktop app: Top Row, First Column, and Freeze at selection, which works like Freeze Panes from the cell you select. In Microsoft Edge, Top Row kept row 1 on screen as we scrolled, and Freeze at selection with B2 selected kept row 1 and column A.
The menu also lists Up to Row and Up to Column items named after the selected cell, such as Up to Row 2 and Up to Column B when B2 is selected. While a freeze is on, Unfreeze Panes is added at the bottom of the menu instead of taking the first place as it does on the desktop.
Microsoft's keyboard guide describes the View tab as the place to freeze rows or columns in your worksheet, and opens it with Alt + Windows logo key, W. If you use Excel for the web on a Mac, Microsoft says to press Control + Option to start instead.
To find the freeze commands by name, press Alt + Windows logo key, Q to jump to the Search box and type freeze. Microsoft notes that Search is available only in Editing mode, so switch to Editing if the workbook opened in Viewing mode. Microsoft's Excel team has also described dragging the handles in the top left corner of the headers, where the row numbers meet the column letters, to set a freeze, and dragging the freeze pane line to change one.
Freeze panes on a Mac, iPad or iPhone
Microsoft's Mac page lists Freeze Top Row, Freeze First Column and Freeze Panes as buttons on the View tab in Excel for Mac. Microsoft's Mac steps are to select Freeze Top Row or Freeze First Column on the View tab, or to select cell B2 and then Freeze Panes for the top row and first column together. A frozen row shows a slightly darker border under it.
For several rows or columns on a Mac, select the row below the last row, or the column right of the last column, you want frozen, then select Freeze Panes. Microsoft's example for the top four rows and three columns selects D5. Unfreeze Panes is a button on the same View tab, and if the Freeze buttons are greyed out, Microsoft says to select Normal on the View tab.
On an iPad, tap View > Freeze Panes and then the option you need, or select the row below the last row you want and tap View > Freeze Panes > Freeze Panes. On an iPhone, Microsoft's steps are to tap the three-dot button to bring up the ribbon, tap Home > View, then scroll down and tap Freeze Panes. To unfreeze on either, tap View > Freeze Panes and clear the selected options.
Keep a row in the middle of the sheet in view
You cannot freeze row 8 and still scroll up to rows 1 to 7, because a freeze holds every row above the line that is on screen. There are two ways round it. The first is to hide the rows above it, then select the cell under it and freeze.
When we hid rows 1 to 7 and froze at A9, only row 8 stayed above the line, and the row numbers jumped from 8 to 156 as we scrolled. The trick lasts only while those rows stay hidden. After we unhid rows 1 to 7, they joined the frozen area, and rows 1 to 8 were all held.
The second way is Split. Select the row below where the split should go and choose View > Split, a small button in the Window group. With row 13 selected, the window divided under row 12, and the lower part scrolled on to row 151 while the upper part still showed rows 1 to 12. Select Split again to remove it.
In Excel for the web there was no Split button. The View tab's Window group held only New Window, Freeze Panes and Full Screen.
Do not mix the two. When we chose Split with panes frozen, Excel turned the freeze lines into split bars in the same place, and choosing Split again removed the split without bringing the freeze back.
When Freeze Panes is greyed out
Freeze Panes does not work in Page Layout view. When we switched a frozen sheet to Page Layout, Excel warned: "Page Layout View is not compatible with Freeze Panes. If you continue, the panes on this sheet will be unfrozen". After OK the freeze was gone, and Freeze Panes stayed greyed out until we chose View > Normal.
Page Break Preview is not a problem. We froze panes in Page Break Preview, and the freeze was still there back in Normal view. Excel does grey out Freeze Panes, along with most of the View tab, while you are typing in a cell, so press Enter or Esc first.
A protected sheet is not the cause either. On a sheet protected with no password and the default options, Freeze Panes and Unfreeze Panes both still worked for us. If there is no View tab at all, Microsoft says you are probably using Excel Starter, which does not support every feature. If Freeze Panes is still not working after these checks, our fix guide goes through the remaining causes one by one.
Print the frozen rows on every page
A freeze only affects the screen. With Freeze Top Row on, page 2 of our print preview started with a customer row and no header. Printing headers is a separate setting called Print Titles.
Select Page Layout > Print Titles, and Page Setup opens on its Sheet tab. In Rows to repeat at top, type $1:$1 for one header row or $1:$2 for two. Then select OK, or Print Preview to check.
With $1:$2, our preview put both header rows at the top of page 2, and the printout grew from 21 to 24 pages, since every page now carries the headers. Microsoft says Print Titles is dimmed while you are editing a cell, when a chart is selected on the same sheet or when no printer is installed.
Excel for the web cannot do this. Microsoft says you can't currently repeat column headers when printing there, and points you to Editing > Open in Desktop App instead. If page breaks give you trouble once the headers repeat, our guide to page breaks not working in Excel covers the fixes.
Use an Excel table to keep headers in view
An Excel table keeps its headers visible without any freeze. Select a cell in your list and choose Home > Format as Table or Insert > Table. Once the header row scrolls away, the header names take the place of the column letters, filter arrows included, as long as the selected cell is inside the table.
When we selected a cell outside the table, the ordinary letters came back. With Freeze Top Row on as well, the frozen header row stayed on screen and the column letters stayed as letters, so you need only one of the two. If you only wanted the headers in view and not the banded colours, you can clear the style or turn the table back into a normal range later.
Two things caught us out when making the table. Our header cells held formulas, and Excel warned that formulas or rich data types in the header row will be removed and converted to static text, with No as the default button. In Excel for the web, use Insert > Table, because Ctrl + T opened a new browser tab when we pressed it there.
What freezing does and does not change
A freeze belongs to one sheet. While our sales sheet was frozen, the notes sheet next to it had no freeze lines at all, so freeze each sheet that needs it. The freeze is saved with the workbook, and after we saved, closed and reopened the file, the sheet was still frozen at C3.
It also belongs to one window. View > New Window opened a second window of the same workbook with nothing frozen, while the first window kept its freeze, and closing the second window asked nothing. Freeze again in the new window if you want the headers there too.
Freezing does not protect anything. Anyone can still type in frozen rows, so to stop changes you lock the cells and use Review > Protect Sheet, which is a separate job.
How we tested this guide
We tested this in Excel for Microsoft 365 on Windows 11, version 25H2, and Excel for the web in Microsoft Edge, freezing and unfreezing rows and columns on invented data.
Frequently Asked Questions
How do I pin both the top row and the first column in Excel?
Select cell B2, then choose View > Freeze Panes > Freeze Panes. Choosing Freeze Top Row and then Freeze First Column keeps only the second one.
Why did Excel freeze more rows than I wanted?
Excel freezes the rows on screen above the selected cell. With B3 selected instead of B2, we got rows 1 and 2 frozen along with column A, and a sheet scrolled down freezes from wherever you were. Unfreeze, press Ctrl + Home, select the right cell and freeze again, and avoid leaving A1 selected.
Can I freeze a row in the middle of the sheet?
Not while keeping the rows above it reachable, because a freeze holds every row above the line that is on screen. Hide the rows above it and freeze, or use View > Split to divide the window at that row.
Why is Freeze Panes greyed out in Excel?
Check two things first. Page Layout view greys it out, and so does a cell that is still being edited, so switch to View > Normal or press Enter or Esc. On a Mac, Microsoft says to select Normal on the View tab.
Do frozen rows print on every page?
No. Use Page Layout > Print Titles and enter the rows in Rows to repeat at top, for example $1:$1, though Excel for the web cannot repeat headers when printing.
Can I undo a freeze with Ctrl + Z?
No. A freeze is not on the Undo list, so Ctrl + Z undoes your previous edit instead. Use View > Freeze Panes > Unfreeze Panes.
Does freezing apply to every sheet in the workbook?
No, only to the sheet you froze, and a new window of the same workbook opens without it. The freeze is kept when you save and reopen the file.
Is freezing a row the same as locking it?
No. Freezing only keeps the row on screen, and anyone can still type in it. To stop changes, lock the cells and protect the sheet.