AutoFit Columns and Rows
Double-click the right-hand edge of a column heading and the column snaps to the width of its longest entry — that is AutoFit. The menu route is Home > Format > AutoFit Column Width, with AutoFit Row Height directly beneath it, and pressing Ctrl+A before double-clicking any column border fits the whole sheet in one action. AutoFit is a one-off action rather than a setting, so a column that fits today will not re-fit itself when longer text lands in it tomorrow.
The formula
double-click a column border AutoFit that column to its longest entry
Ctrl+A, then double-click a border AutoFit every column on the sheet
Alt+H, O, I AutoFit Column Width from the keyboard
Alt+H, O, A AutoFit Row Height from the keyboard
Home > Format > AutoFit Row Height hands a manually-sized row back to automatic heightA worked example
Column B holds product names between 4 and 38 characters long, and column C holds dates showing as #####.
Select headings B and C, then double-click the border between any two selected headings
B widens to the 38-character name and C widens just far enough for the dates, so the ##### disappears. Nothing was ever lost: ##### only means a number or date is too wide for its column, and the underlying value is unchanged the whole time.
Which one do I need?
| If you want to… | Use |
|---|---|
| Making a column exactly as wide as its longest entry | Double-click the right edge of its heading, or Home > Format > AutoFit Column Width |
| Making a row exactly as tall as its tallest cell | Double-click the bottom edge of the row number, or Home > Format > AutoFit Row Height |
| Fitting every column on the sheet at once | Ctrl+A to select everything, then double-click any one column border |
| Sizing to a number you choose instead of to the contents | Right-click the heading > Column Width, or the row number > Row Height, and type the value |
| AutoFit Row Height does nothing on a row of merged cells | Merged cells are excluded from AutoFit — unmerge, then use Ctrl+1 > Alignment > Center Across Selection for the same look |
| Text is still cut off after autofitting | The cell most likely has Wrap Text on, which caps the width at the column and grows the height instead |
Frequently asked questions
Why does AutoFit Row Height do nothing on my row?
Two causes account for nearly all of it. The row contains a merged cell, and AutoFit skips merged cells completely — unmerge and use Center Across Selection if the look is what you were after. Or the height was set by hand at some point: dragging a row border even once marks the row as manually sized, and Home > Format > AutoFit Row Height is what hands control back to Excel.
Does AutoFit keep working as the data changes?
No. It measures the contents once and writes a fixed size, so pasting a longer value in afterwards leaves the column where it was and you have to run it again. The one exception is row height on a wrapped cell whose height has never been set manually — that keeps growing on its own as the text needs more lines.
Why does AutoFit make my column far wider than the data needs?
AutoFit measures every cell in the column, including the header and any stray long value sitting far below the block you were looking at. Press Ctrl+End to see where the used range actually stops. To fit only part of a column, select just those cells and use Home > Format > AutoFit Column Width, which measures the selection rather than the entire column.
What does ##### mean, and does AutoFit clear it?
It means the column is too narrow for a number or a date — Excel never lets those spill into the next cell the way plain text does. AutoFit normally clears it in one double-click. If it comes back, the cell has Wrap Text on, or a manual width, or a number format long enough (a date with the weekday and month spelled out, for instance) that the column genuinely needs that much room.
New guides and tools, once a month
DE + EN · double opt-in · no spam