Skip to content
CtrlKFind a shortcut

Excel AutoFit Shortcut for Column Width and Row Height

ExcelExcelColumn widthChecked 2 Nov 2026

AutoFit column width

AltHO

Then I, pressed one after another

AutoFit row height

AltHO

Then A

Set an exact width

AltHO

Then W, type the width

The excel autofit shortcut for column width is Alt, H, O, I, pressed one after another. Highlight the columns beforehand, or everything via Ctrl + A, and Excel makes every column just wide enough for its longest entry.

For rows, end with A instead of I. With the mouse, double clicking the line between two column letters does the same thing for that column.

Quick facts

  • Column width

    Alt, then H, then O, then I
  • Row height

    Alt, then H, then O, then A
  • Exact column width

    Alt, then H, then O, then W
  • Exact row height

    Alt, then H, then O, then H
  • Whole sheet

    Ctrl + A first
  • Mouse

    Double click the border

Excel autofit shortcut keys

Width and height keys
ActionKeys
AutoFit column widthAlt, then H, then O, then I
AutoFit row heightAlt, then H, then O, then A
Type an exact column widthAlt, then H, then O, then W
Type an exact row heightAlt, then H, then O, then H
Set the default width for the sheetAlt, then H, then O, then D

Press each key separately. After Alt, small letters appear on the ribbon and guide the next press.

How to auto adjust column width in Excel with the shortcut

  1. Pick a cell inside the column; for a group of columns, press Ctrl + Space then stretch the selection with Shift + Right.
  2. Tap Alt, H, O and finally I.
  3. The columns resize to fit their longest content.

To fit every column at once, press Ctrl + A (twice if you are inside a table) before the keys. This is the fastest way to tidy a sheet exported from billing software, where all columns arrive the same width.

Fix ##### in Excel cells

When a column is too narrow for a number or date, Excel shows ##### instead of the value. The data is fine; it just does not fit. AutoFit the column and the value appears. Text behaves differently: it spills into the next empty cell, or gets cut off if the next cell has data.

AutoFit makes columns as wide as the longest entry, which can be huge for a long note. For those columns, set a fixed width and use wrap text instead.

Row height in Excel shortcut and wrapped text

Rows normally grow by themselves when you wrap text. If a row stays too short or too tall after editing, select it and press Alt, H, O, A. Rows with merged cells are the exception: AutoFit ignores them, so set their height by hand with Alt, H, O, H. The wrap text shortcut explains wrapping.

When AutoFit does not work

Problems and fixes
ProblemFix
Column barely changesA long hidden entry far down is setting the width; check with Ctrl + Down
Row height does not fitMerged cells in the row; set the height by hand
Keys do nothingYou are editing a cell; press Esc first
Sheet is protectedFormatting columns may be locked; unprotect it
An HR assistant pastes a staff list from an email and every column shows half the names. One Ctrl + A followed by Alt, H, O, I makes the whole list readable before printing.

Frequently asked questions

What is the autofit shortcut in Excel?
Alt, H, O, I for column width.
How do I adjust column width in Excel with the keyboard?

AutoFit with Alt, H, O, I, or type a width after Alt, H, O, W.

How do I autofit all columns at once?

Select the whole sheet with Ctrl + A, then use the AutoFit keys.

What is the row height shortcut in Excel?
Alt, H, O, A to AutoFit, or H as the last key to type a height.
Why does my cell show #####?

The column is too narrow for the number or date. AutoFit it.

Can I double click to autofit?

Yes, double click the line on the right of the column letter.