How To Expand All Columns In Excel | AutoFit in Seconds

To expand all columns in Excel at once, select the entire sheet and double-click any column boundary — AutoFit instantly matches every column to its longest entry.

Scrolling sideways through cut-off cells slows down any spreadsheet task. How to expand all columns in Excel comes down to one two-second move: select the whole sheet and let AutoFit do the work. Click the top-left arrow between row 1 and column A — or press Ctrl + A twice to grab every cell — then double-click the boundary line between any two column headers. Every column widens to fit its longest piece of content. No dragging, no guessing, no wasted time.

The Fastest Way: Double-Click The Boundary

This is the method experienced Excel users reach for because it requires zero menu navigation. Select all columns — Ctrl + A once selects the current data range; pressing it again selects the entire worksheet. Move your cursor to the boundary line between any two column headers, say between A and B. The cursor changes to a double-headed arrow. Double-click. Every column in your selection expands instantly to the width of its longest entry.

This works identically in Excel for Windows, Mac, and the web version. No shortcut to memorize, no ribbon to hunt through. Microsoft’s official Excel documentation confirms AutoFit reads the widest cell content in each column and sets the width to match.

Expanding All Columns In Excel: The One-Second Shortcut

Keyboard users get a dedicated sequence that fires the same command. Select all columns with Ctrl + A, then press these keys one after another — never held down together:

AltHOI

This shortcut appeared with Excel 2007’s ribbon interface and works in every version since, including Excel 2021 and Microsoft 365. Each key activates a ribbon layer: Alt opens the key tips, H selects Home, O opens Format, and I runs AutoFit Column Width.

Why The Sequence Matters

The most common mistake with Alt + H + O + I is pressing all four keys simultaneously. That triggers nothing — or launches an unrelated command. Each key press is a separate step. Release one before pressing the next.

Legacy Excel 2003 used a different sequence: Alt + O + C + A. Modern Excel ignores that older shortcut, so if you recently upgraded, the four-key ribbon sequence is the one to learn.

Quick Reference: Expand All Columns In Excel

Method Steps To Follow Platform Support
Double-Click Boundary Select all (Ctrl+A), double-click any column boundary Windows, Mac, Web
Ribbon Menu Select all → Home → Format → AutoFit Column Width Windows, Mac, Web
Keyboard (Alt+H+O+I) Select all, press Alt → H → O → I (sequential) Windows only
Keyboard (Alt+O+C+A) Select all, press Alt → O → C → A (Excel 2003) Windows (legacy)
VBA Macro Alt+F11 → Insert Module → paste code → run Windows, Mac
Custom Mac Shortcut System Prefs → Keyboard → App Shortcuts → add “AutoFit Selection” Mac only
Manual Drag Click and drag a column boundary to the desired width All platforms

Using The Ribbon Menu Instead

When keyboard shortcuts aren’t available — or you prefer clicking through menus — the ribbon path works everywhere. Select all columns, then go to Home > Format (in the Cells group) > AutoFit Column Width. This is the safest fallback for Mac users and anyone working in Excel for the web, where keyboard shortcuts do not function.

What About Mac, Web, And Mobile?

AutoFit itself is available on most platforms, but how you trigger it changes. Mac users cannot use Alt + H + O + I — Excel for Mac doesn’t support Alt-based shortcuts. The ribbon method works fine: select all, then Home > Format > AutoFit Column Width. Power users who want a keyboard shortcut can create one in System Preferences > Keyboard > App Shortcuts. Add a shortcut for Excel with the exact menu title “AutoFit Selection” — case matters. Assign a combination like Cmd + Shift + A.

Excel for the Web supports AutoFit through the ribbon only. Keyboard shortcuts do not work in the browser interface. Excel mobile apps (iOS and Android) lack AutoFit entirely. You must drag column boundaries by hand on a phone or tablet.

Automating With A VBA Macro

If you expand all columns repeatedly — same report, same layout, every week — a one-line VBA macro saves the clicks. Press Alt + F11 to open the VBA editor, go to Insert > Module, and paste this:

Sub ExpandAllColumns()
    Cells.EntireColumn.AutoFit
End Sub

Close the editor and run the macro with Alt + F8. Assign it to a button or a custom keyboard shortcut if you use it daily. The macro works on any Windows or Mac version of Excel that supports VBA.

Platform Compatibility For Each AutoFit Method

Platform AutoFit Available Keyboard Shortcut Works
Windows (Excel 2007+) ✓ Alt+H+O+I
Windows (Excel 2003) ✓ Alt+O+C+A
Mac ✗ (custom setup needed)
Web (Microsoft 365)
Mobile iOS ✗ (drag only)
Mobile Android ✗ (drag only)

Final Reference: Which Method Fits Your Setup

Your platform determines the fastest route. On Windows, the double-click or Alt + H + O + I shortcut is instant. On Mac, use the ribbon or a custom keyboard shortcut you set up yourself. In the web version, the ribbon menu is your only option. Mobile users must drag column boundaries manually — no workaround exists. For recurring tasks on any desktop platform, the VBA macro eliminates repetition entirely. Pick the method that matches your environment, and you will never manually widen columns again.

References & Sources

Please use a real email you check. If it's fake or mistyped, your message won't reach us and we can't reply — wrong addresses are rejected automatically.