Cellwise Start free

Formatting shortcuts

AutoFit column width shortcut in Excel

Quick answerOn Windows, select the columns and press Alt, then H, O, I (Home > Format > AutoFit Column Width). For row height, Alt, H, O, A. On a Mac, there is no shortcut: double-click the right edge of the column header, or use Format > Column > AutoFit Selection in the menu bar.

The keys

ShortcutWindowsMac
Select the current region, then the whole sheetPress once for the block of data around the active cell, again to add its summary rows, and again for the whole sheet.CtrlA or CtrlShiftSpaceCommandA or CommandShiftSpace
Select the entire column How to: Insert row shortcut in Excel On a Mac, Control+Space also switches input sources in macOS. If it does that, turn the macOS shortcut off in System Settings > Keyboard > Keyboard Shortcuts.CtrlSpaceControlSpace
Open Format Cells How to: Merge cells shortcut in Excel Every number, date, alignment, border and protection option in one dialog.Ctrl1Command1 or Control1

Checked against Microsoft's official lists on . Where Microsoft lists a key for one platform only, the other column says so instead of guessing.

Autofit every column at once

Press CtrlA until the whole sheet is selected (twice inside data), then Alt, H, O, I. Every column fits its widest entry. With the mouse, select all and double-click any column border.

To fit a column to one cell only, such as a heading, select just that cell and use the same keys: AutoFit then measures only the selection.

Why AutoFit ignores some cells

Set an exact width

On Windows, Alt, H, O, W opens Column Width so you can type a number, and Alt, H, O, H sets Row Height. On a Mac, use Format > Column > Width in the menu bar.

Why a shortcut sometimes does nothing

KeyTips change with the language

Alt sequences such as AltH, O, I are ribbon KeyTips: press Alt and the letters appear on screen. They come from the English ribbon. In another language, or when an add-in adds a tab, the letters can differ, so read them off the screen rather than memorizing them.

Related shortcuts

ShortcutWindowsMac
Show the KeyTips (letters on every tab and button)Press and release, then type the letters that appear. Excel for the web on a Mac: Microsoft says to press Control+Option to start.Alt or F10Web AltWindows key—No Mac shortcut in Microsoft's list
Go to the Home tabAltHWeb AltWindows key, H—No Mac shortcut in Microsoft's list

FAQ

What is the shortcut to autofit columns in Excel?

On Windows, select the columns and press Alt, H, O, I in turn. On a Mac, double-click the right edge of a column header; there is no keyboard shortcut.

How do I autofit row height?

Alt, H, O, A on Windows. On a Mac, double-click the bottom edge of the row header.

Why is my column showing ##### after autofit?

The value is wider than the column again, often because the number format or font changed after fitting. Autofit again, or see why Excel shows #####.

Related guides

In the glossary: ##### (hash marks)Merged cellsWrap Text

All formatting shortcutsAll Excel shortcutsPrintable sheet