In Excel: go to View ▸ Freeze Panes and choose Freeze Top Row, Freeze First Column, or Freeze Panes to lock rows and columns above and left of the active cell in place while you scroll.
To lock just the header, open the View tab and click Freeze Panes ▸ Freeze Top Row.
To lock the leftmost column, click Freeze Panes ▸ Freeze First Column.
To lock several rows and columns at once, select the cell just below and to the right of them (e.g. B2 for row 1 + column A), then Freeze Panes ▸ Freeze Panes.
To undo it, return to View ▸ Freeze Panes ▸ Unfreeze Panes.
What this does
Freezing keeps chosen rows or columns pinned on screen so they stay visible no matter how far you scroll — purely a viewing aid that never alters a value or who can edit it. View ▸ Freeze Panes offers three options: Freeze Top Row locks row 1, Freeze First Column locks column A, and Freeze Panes locks everything above and to the left of whatever cell is selected. Only the top and left edges can be frozen; you cannot freeze a band in the middle of the sheet. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. For “excel how to lock top row”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected rows change, and only then apply the same setup to the full sheet. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That is what makes a layout choice that keeps the sheet readable and sortable useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
A sheet has headers in row 1 and 500 data rows below. Click View ▸ Freeze Panes ▸ Freeze Top Row: a thin line appears under row 1, and as you scroll down to row 480 the headers Name, Region, Total stay fixed at the top. To pin both the header row and the first column at once, select cell B2 first, then View ▸ Freeze Panes ▸ Freeze Panes — now row 1 and column A both stay put while the rest of the grid scrolls under them. Reach for Freeze Panes whenever a long or wide table scrolls its headers out of sight — a 500-row register, a budget that runs across dozens of columns, any sheet where you keep losing track of which column is which. It costs nothing, changes no data, and makes navigation far less error-prone. If there is any chance you will reuse this, drop it into a small template tab right now: a labelled input area on the left and the formula beside it, checked once against the tool above. Next time the same question comes up, the answer is a single paste away instead of a rebuild from memory.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. If you take one thing from this page on “excel how to lock top row”, make it the habit rather than the keystrokes: set the problem up with labelled inputs, reference those cells, and let Excel do the recomputing. Bookmark the page for the syntax, but do the example once in a blank sheet and check it against the tool above — five minutes of hands-on practice fixes the method in memory far better than re-reading, and it surfaces the small snags while they are still harmless. After that the technique is genuinely yours: faster than searching for it again, and reliable enough to drop into work that other people depend on.
Common mistakes
- Expecting to freeze a row in the middle of the sheet — only rows above and columns left of the selected cell can be frozen.
- Selecting row 1 instead of cell
B2before Freeze Panes, so the column you wanted held does not stay put. - Confusing freezing with locking for protection — freezing only affects scrolling, never whether a cell can be edited.
- Using Split (which creates resizable, scrollable panes) when you actually wanted a fixed frozen header.
Frequently asked questions
How do I freeze the top row and first column together?
Click cell B2 so the active cell sits just below row 1 and just right of column A, then View ▸ Freeze Panes ▸ Freeze Panes pins both at once.
Why is Freeze Panes greyed out?
It is disabled while you are editing a cell or when the sheet is in Page Layout view. Press Enter to finish editing and switch to Normal view first.
Does freezing print or change the data?
No — it only affects what stays on screen while scrolling. Printed pages and stored values are unaffected; for repeating headers on every printed page use Page Layout ▸ Print Titles instead.
Other ways people ask this
On the way here you may have searched this as “excel lock top row”, “how to lock the top row in excel”, “excel lock row at top” and “how do i lock the top row in excel” — it is all the same task, and this page is the single, complete answer to it.
Why do people search for this in so many different ways?
Because the same task has many names. “excel lock top row”, “how to lock the top row in excel”, “excel lock row at top” all point at the one operation explained on this page, which is why they all lead here.