How to Make Cell Height Autofit in Excel
In this article
To make cell height autofit in Excel, select the rows you want to resize, then go to Home > Format > AutoFit Row Height (in the Cells group). Alternatively, double-click the bottom border of a row header, or press Alt+H+O+A on Windows. On Mac, use Format > AutoFit Row Height from the menu bar. This makes each row grow or shrink to fit its tallest wrapped or multi-line entry, so no text is cut off. You need nothing beyond Excel itself, though the sheet should be saved first if you are experimenting.
What You'll Need
- Excel for Windows, Mac, or the web (steps are for desktop; web has limited autofit).
- A worksheet with rows you want to resize.
- Optional: a backup copy if you plan to change many rows at once.
Step-by-Step
- Select the rows. Click the row number on the left to select one row. To select several, drag across the row numbers, or hold Ctrl (Windows) or Command (Mac) and click each number. To select all rows, click the small triangle at the top-left corner above row 1.
- Open the Format menu. On the Home tab, find the Cells group and click Format. On Mac, you can also use the Format menu in the menu bar. Menu labels can differ slightly by version, device, or region.
- Choose AutoFit Row Height. In the Format dropdown, under Cell Size, click AutoFit Row Height. The selected rows resize immediately.
- Or double-click the row border. Move the pointer to the line between two row numbers until it becomes a double-headed arrow, then double-click. This autofits that row (or all selected rows) to the tallest cell.
- Or use the keyboard shortcut. On Windows, press Alt, then H, then O, then A. This opens the same AutoFit Row Height command. On Mac, there is no default single shortcut; use the Format menu.
- Check wrapped text. Autofit only works well if the cell has Wrap Text turned on. Select the cells, go to Home > Wrap Text. Without it, long text may spill into empty adjacent cells rather than increasing row height.
- Undo if needed. Press Ctrl+Z (Windows) or Command+Z (Mac) to revert. Autofit changes are not permanent until you save.
Common Mistakes
- Selecting cells instead of rows. Autofit Row Height works on entire rows. If you select only a cell, Excel may still autofit the row, but selecting the row number is more reliable.
- Forgetting Wrap Text. Without wrapping, long text does not increase row height; it overflows or gets clipped by adjacent content.
- Merged cells. Autofit does not work on merged cells. Unmerge first, autofit, then merge again if needed.
- Manual row height set. If a row height was set manually, autofit may not shrink it. Use Format > Row Height and set it to a smaller value, or double-click the border to reset.
- Using autofit on the web version. Excel for the web has limited autofit; double-clicking row borders may not work. Use the desktop app for full control.
Tips
- To autofit all rows at once, click the triangle at the top-left corner, then use AutoFit Row Height.
- Autofit also works for columns: select columns and choose AutoFit Column Width.
- If rows become too tall, check for extra line breaks (Alt+Enter) inside cells.
- After autofitting, you can still drag a row border to fine-tune; that sets a manual height.
- Use Ctrl+Z immediately if autofit makes rows unexpectedly large.
Troubleshooting
If rows do not resize, first check that Wrap Text is on and that no cells are merged. Next, confirm the row height is not locked by a manual setting: select the row, go to Format > Row Height, and note the value; then try AutoFit again. If the row still does not change, the content may be in a text box or shape, which does not affect row height. Also check for hidden rows or a filter that is hiding the row. In Excel for the web, autofit may be unavailable; open the file in the desktop app. If the file is shared and protected, you may need to unprotect the sheet (Review > Unprotect Sheet) before resizing. Finally, restart Excel if the ribbon commands are unresponsive.
Frequently Asked Questions
Why does autofit not shrink my row?
A manual row height may be set. Select the row, open Format > Row Height, and set a smaller number, or double-click the row border to reset to autofit.
Can I autofit all rows at once?
Yes. Click the triangle at the top-left corner above row 1 to select all, then use Home > Format > AutoFit Row Height.
Does autofit work with merged cells?
No. Autofit Row Height does not adjust merged cells. Unmerge, autofit, then merge again if needed.
What is the keyboard shortcut for autofit row height?
On Windows: Alt, H, O, A. On Mac, use the Format menu; there is no default single shortcut.
Why is my row height not changing in Excel for the web?
The web version has limited autofit. Use the desktop app for full row height autofit.
Can I autofit only visible rows?
Autofit applies to selected rows. If rows are hidden by a filter, unhide or clear the filter first, then select and autofit.