56 free macros indexedAll toolsHow to runBlogGitHub ↗

How to Freeze the Top Row on All Sheets at Once in Excel

Excel freezes panes one sheet at a time. To freeze the top row on all sheets at once, use a free macro that locks row 1 on every visible tab in one run.

2026-07-05

The fastest way to freeze the top row on every sheet

To freeze the top row on all sheets at once in Excel, you need a macro, because Excel has no built-in way to do it. Freeze Panes is a per sheet setting. You open one tab, freeze the top row, then repeat on the next tab, and the next. On a 20-tab workbook that's 20 trips through the same menu.

A macro loops every visible sheet and locks row 1 on each one in a single run. Here's how the options compare.

MethodSheets coveredOne click?
View > Freeze PanesOne at a timeNo
Group sheets firstStill one at a timeNo
Free macroEvery visible sheetYes

TL;DR: Key takeaways

  • Excel freezes panes one sheet at a time. There's no native "apply to all sheets" button.
  • On a single sheet, use View > Freeze Panes > Freeze Top Row.
  • Grouping sheets does not copy freeze panes to the group. It's a common wrong turn.
  • The free macro freezes the top row on every visible sheet in one run and reports how many it changed.
  • The macro skips hidden sheets and resets any existing freeze first, so rerunning it fixes inconsistent tabs.

How to freeze the top row on a single sheet

For one sheet, Excel's built-in command does the job. This is the official Microsoft freeze panes route.

  1. Click the sheet tab you want to freeze.
  2. Go to the View tab on the ribbon.
  3. Click Freeze Panes, then Freeze Top Row.

Row 1 now stays put while you scroll. A thin line appears under it to show the freeze is active. To undo it, go back to View > Freeze Panes > Unfreeze Panes.

That's fast for one sheet. The trouble starts when the workbook has ten of them.

The problem: Excel does this one sheet at a time

Freeze Panes is tied to the window view of a single worksheet, not to the workbook. So the setting doesn't travel. Freeze the top row on your January tab and February stays unfrozen. There's no checkbox for "every sheet."

Plenty of people try to group the sheets first. You Ctrl+click the tabs, or right-click and choose Select All Sheets, hoping one Freeze Top Row hits the whole group. It doesn't. Grouping shares edits to cells and formatting, but freeze panes isn't a cell setting, so it stays put on the active sheet only. You end up right where you started, just more annoyed.

For a workbook with a header row on every tab, like a monthly report or a multi-branch export, freezing each one by hand is slow and easy to forget. Miss one tab and that's the sheet where you scroll down and lose track of which column is which.

How to freeze the top row on all sheets at once

To freeze the top row on all sheets at once, run a macro that walks each sheet and applies the freeze for you. Download Freeze Top Row on All Sheets. It's a free .xlsm file with one macro. No signup, and it runs offline so your workbook never leaves your machine.

First time running one of our macros? See How to run our tools for the 30-second setup.

  1. Open the workbook you want to freeze.
  2. Press Alt + F8, pick FreezeTopRowAllSheets, and click Run.
  3. The macro freezes row 1 on every visible sheet, returns you to the tab you started on, and pops a message with the count.

Under the hood it's a short loop. If you'd rather paste the code into your own workbook, here it is:

Sub FreezeTopRowAllSheets()
    Dim ws As Worksheet
    Dim startSheet As Worksheet
    Set startSheet = ActiveSheet
    Application.ScreenUpdating = False
    For Each ws In ActiveWorkbook.Worksheets
        If ws.Visible = xlSheetVisible Then
            ws.Activate
            ActiveWindow.FreezePanes = False
            ws.Range("A2").Select
            ActiveWindow.FreezePanes = True
        End If
    Next ws
    startSheet.Activate
    Application.ScreenUpdating = True
End Sub

Selecting cell A2 before freezing is the trick. Freeze Panes locks everything above and to the left of the active cell, so A2 freezes row 1 and nothing else. No frozen columns, just the header.

Example: a monthly reporting workbook

A finance analyst at a 6-branch retail chain in Pune keeps one workbook with a tab per branch, plus a summary tab. Every month the data refreshes and the freeze panes get wiped on the tabs that were rebuilt. Some tabs scroll with a locked header, some don't, and nobody remembers which.

Setting them by hand meant clicking through seven tabs, hitting Freeze Top Row on each, and hoping none got skipped. About two minutes of clicking, every month, for a job the computer should do.

Now the analyst opens the refreshed workbook, presses Alt + F8, and runs the macro. Every visible tab gets the same top-row freeze in one pass, and the message confirms "Froze the top row on 7 visible sheet(s)." The two minutes of menu clicking turns into about two seconds, and no tab gets missed.

Hidden sheets, columns, and unfreezing

Three honest details, so you know exactly what the macro touches.

It skips hidden sheets. The loop only freezes sheets that are visible. If you want a hidden tab frozen too, unhide the sheets first, then run it.

It freezes the top row only, not columns. The macro locks row 1 on each sheet. It doesn't freeze any columns, so your leftmost column still scrolls sideways normally.

Rerunning is safe. The macro clears any existing freeze on each sheet before applying the new one. So if half your tabs are frozen and half aren't, one run makes them all consistent instead of doubling anything up. To remove the freeze later, use View > Freeze Panes > Unfreeze Panes on each sheet.

For more multi-sheet jobs, protect every sheet with a password works the same way across a whole workbook, and both sit inside the guide to Excel productivity macros.

FAQ

Can you freeze the top row on all sheets at once in Excel?

Not with a built-in command. Excel's Freeze Panes only applies to the active sheet, so you'd normally repeat it on each tab. A macro is the one-step option: it loops through every visible sheet and freezes the top row on each in a single run, then tells you how many it changed.

Does grouping sheets let me freeze panes on all of them?

No. Grouping sheets shares cell edits and formatting, but freeze panes is a window view setting, not a cell setting, so it only applies to the active sheet. After you ungroup, the other tabs are still unfrozen. This is why grouping feels like it should work but doesn't.

How do I freeze the top row on multiple worksheets at the same time?

Run a macro that activates each sheet and applies Freeze Panes at cell A2, which locks row 1. The free FreezeTopRowAllSheets macro does exactly this across every visible tab, or you can paste the short VBA loop above into your own workbook and run it once.

Will the macro freeze columns too?

No, it freezes only the top row. It selects cell A2 before applying Freeze Panes, so everything above row 2 locks and nothing to the left does. Your columns still scroll left and right as usual. Only the header row stays pinned while you scroll down.

How do I unfreeze the top row again?

Go to the View tab, click Freeze Panes, then Unfreeze Panes. Excel unfreezes one sheet at a time, the same way it freezes. If you rerun the freeze macro after unfreezing, it resets each sheet first, so you never end up with a stuck or doubled freeze.

What to do next

For a single tab, use View > Freeze Panes > Freeze Top Row. For a whole workbook of tabs, don't click through the menu on each one.

Download the free Freeze Top Row on All Sheets macro and run it on your own workbook. It freezes the top row on all sheets at once, skips hidden tabs, and reports the count, so every header stays visible no matter which tab you land on.