In Excel for Microsoft 365 on Windows, use Alt, H, O, I to AutoFit a column to its contents, or Alt, H, O, A to AutoFit a row. Select the relevant column, row, or cells first; Excel adjusts the width of whole columns and the height of whole rows, not one cell in isolation.
What the cell adjustment shortcut does
People often use “adjust a cell” to mean making its contents visible by changing its size. Excel’s grid does not let you resize a single cell independently: every cell in a column shares that column’s width, and every cell in a row shares that row’s height. As a result, an adjustment made for one cell can also affect neighboring cells in the same row or column.
AutoFit is the quickest option when you want Excel to choose a suitable size from the content. The column shortcut adjusts width to accommodate the widest relevant entry in the selected column or columns. The row shortcut adjusts height to fit the content in the selected row or rows, including wrapped text where applicable. These commands change dimensions; they do not change the font size or rewrite cell contents.
Windows shortcuts and ribbon commands
The Windows shortcuts are sequences of ribbon KeyTips. Press the keys in order rather than holding them all down together:
- AutoFit column width: press Alt, then H, then O, then I.
- AutoFit row height: press Alt, then H, then O, then A.
- Set a specific column width: press Alt, H, O, W, enter a value, and press Enter.
- Set a specific row height: press Alt, H, O, H, enter a value, and press Enter.
The equivalent ribbon commands are Home > Format > AutoFit Column Width and Home > Format > AutoFit Row Height. For a fixed measurement, choose Column Width or Row Height from the same Format menu. These are useful alternatives if a keyboard layout, remote desktop, or accessibility setting makes a KeyTip sequence inconvenient.
How to select what Excel adjusts
Selection determines the scope of the operation. To fit one column, select a cell in it or click its letter heading, then run the column command. To fit several adjacent columns, drag across their headings or select a range that spans them. For separate, nonadjacent columns, hold Ctrl while clicking their headings, then use AutoFit. You can use the same selection approach with row numbers for row height.
- Identify whether the problem is width, height, or both. A clipped long heading usually needs a wider column; several lines of wrapped text usually need a taller row.
- Select the relevant column headings, row numbers, or cells.
- Run the matching AutoFit shortcut or choose the command from Home > Format.
- Inspect the result. If the size is awkward, use a fixed measurement or drag a boundary instead.
To apply a change across a worksheet, select the whole sheet using the triangle at the intersection of the row and column headings, then choose the appropriate AutoFit command. This can make a large sheet unwieldy if a single cell contains a very long note or identifier, so consider selecting only the columns or rows that need attention. AutoFit affects the selected dimensions, not just the cells that currently contain data.
AutoFit compared with dragging or setting a size
AutoFit is content-led: Excel calculates a dimension based on what is displayed in the selected rows or columns. Dragging is user-led: you choose the dimension visually. To drag, move the pointer to the boundary between two column letters or row numbers; when the resize pointer appears, drag the boundary. Double-clicking that boundary runs an AutoFit-style adjustment for the column or row beside it.
A fixed measurement is more useful when a table needs consistent proportions. For example, a report may look better with every month column set to the same width even if one month has a longer label. Use Home > Format > Column Width or Row Height and enter a value. Column width is not a direct pixel measurement: it is based on character width using the workbook’s default font, so the displayed pixel size can vary with font settings and Excel’s rendering.
- Choose AutoFit when you want to reveal ordinary text without estimating a size.
- Drag when you want a quick visual adjustment and do not need an exact measurement.
- Enter a fixed size when consistency across a table or report matters more than fitting each entry exactly.
Wrapped text and changing row height
For a long description that should remain inside a narrow column, wrapping is often better than making the column extremely wide. Select the cells and choose Home > Wrap Text. Excel displays the text on multiple lines within the existing column width; AutoFit Row Height can then increase the row height to show those lines. If the column is too narrow, however, the result may be a very tall row, so widening it slightly can improve readability.
Changing the column width can also change how many lines of wrapped text fit in each cell. Excel may recalculate row heights as the layout changes, but if text still appears clipped, select the affected rows and run AutoFit Row Height again. A manually set row height can prevent the row from expanding as expected; using AutoFit or setting a larger height can resolve that. Check the font size and cell alignment too, since those affect the space the content needs.
Common sizing problems and limitations
AutoFit is not a guarantee that every cell will look ideal. It sizes dimensions according to visible content and Excel’s layout rules, which can produce a very wide column if an entry is unusually long. A long URL, tracking code, or unbroken string may have no natural place to wrap. In that case, consider wrapping text, widening the column, shortening or splitting the displayed value, or using a fixed size that suits the rest of the sheet.
Merged cells are another common exception. AutoFit may not correctly calculate the row height or column width needed for text in a merged range. If a merged heading is cut off, try adjusting the row height or column width manually, or reconsider whether merging is necessary. For a heading spanning several columns, Center Across Selection is sometimes a practical alternative to merging, because it preserves separate cells; it is available in the Alignment settings in Format Cells.
Also check whether the affected row or column is hidden. AutoFit does not make a hidden row or column visible as a normal resize would. Select the surrounding row numbers or column letters, then use the unhide command from the relevant context menu or from Home > Format. If a worksheet is protected, formatting changes may be restricted unless the sheet’s protection settings allow row or column formatting.
Excel for Mac and Excel for the web
The Alt-based KeyTip sequence above is for Excel on Windows. On Mac, the Windows sequence is not the equivalent keyboard shortcut. Use the ribbon command instead: select the relevant columns or rows, then choose Home > Format > AutoFit Column Width or AutoFit Row Height. Available keyboard shortcuts can differ by Mac version, keyboard layout, and system settings, so the ribbon is the dependable route if a shortcut is not available.
Excel for the web also provides AutoFit through the ribbon’s Home and Format controls. Depending on the browser and keyboard, Windows desktop KeyTips may not behave the same way in the web app. If the sequence does not open the expected command, use the ribbon or double-click a row or column boundary. The underlying idea is the same: select the dimensions to change, then fit them to their contents.
Frequently Asked Questions
What is the shortcut to AutoFit a column in Excel?
In Excel for Microsoft 365 on Windows, select the column or a cell in it and press Alt, H, O, I in sequence. This runs AutoFit Column Width.
What is the shortcut to AutoFit row height?
Select the row or rows, then press Alt, H, O, A in sequence on Windows. Excel adjusts their heights to fit displayed contents where its layout rules permit.
Can I resize just one cell in Excel?
No. A cell’s width belongs to its entire column, and its height belongs to its entire row. You can make text fit differently with wrapping, alignment, or formatting, but changing the cell’s dimensions changes the shared row or column.
Why does AutoFit not show all my text?
Check for a fixed row height, merged cells, hidden rows or columns, or a long unbroken value. Try Wrap Text and AutoFit Row Height, adjust the dimensions manually, or use a wider column for content that cannot wrap naturally.
Does AutoFit work in Excel for Mac?
Yes. Select the rows or columns and use Home > Format > AutoFit Row Height or AutoFit Column Width. The Windows Alt KeyTip sequence is not the Mac equivalent.
How do I make every column the same width?
Select the columns you want to standardize, choose Home > Format > Column Width, enter a measurement, and confirm. AutoFit is designed to fit contents, so it may give different columns different widths.
Related
- Group Rows in Excel by the Same Name
- Excel: Copy Subtotal Rows Only Without Detail Rows
- How to Hyperlink to Another Cell in Excel
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Freeze Multiple Rows in Excel: Step-by-Step GuideTo freeze multiple rows in Excel, select the cell in column A directly below the last row you…
- Find and Replace in Excel: Select Data FirstTo find and replace text in only part of an Excel worksheet, select the cells or range first,…
- Excel Date Calendar Drop-Down: What Works and What Doesn’tIn Excel for Microsoft 365 on Windows, an ordinary worksheet cell does not have a built-in calendar drop-down.…
- Insert a Blank Row in Excel After Every Row of DataTo insert a blank row after every data row in Excel, add a temporary helper column, number your…
- Excel Column Width and Row Height: Are They Equal?No. Excel column width and row height use different units, so entering the same number for each does…
- Excel All Caps Shortcut: The Fastest Ways to Change CaseExcel has no built-in keyboard shortcut that changes selected text to all caps. To convert text reliably, enter…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.