To autofit row height in Excel for Microsoft 365 on Windows, select the row or rows, then press Alt, H, O, A in sequence. Excel adjusts the selected rows to fit their contents. You can also use Home > Format > AutoFit Row Height or double-click a row-header boundary.
This is useful when text is clipped, wrapped onto several lines, or displayed with a larger font. The adjustment changes row height, not column width; if a cell needs more horizontal space, resize the column separately.
What You’ll Need
- A workbook open in Excel, with the rows you want to adjust visible and selected.
- For the keyboard method, Excel for Microsoft 365 on Windows. The Alt-key sequence below is a Windows ribbon shortcut, not a simultaneous key combination.
- If you are using a Mac or Excel for the web, use the ribbon or row-header method described below; the Windows key sequence may not apply.
Step-by-Step
- Identify the rows that need more room. Look for clipped text, cells showing only part of a value, or wrapped paragraphs whose lower lines are hidden. If you only need to fix a few rows, there is no need to resize the whole sheet.
- Select the row or rows. Click a row number at the left edge of the worksheet to select that entire row. To select a continuous group, click the first row number and drag down to the last, or click the first row number, hold Shift, and click the last. You can also select cells within the rows, but selecting row headers makes the intended range clear. For separate, nonadjacent groups, handle each group individually.
- Use the Windows keyboard shortcut. Press and release Alt, then H, then O, then A. Do not hold all four keys down together. These are ribbon Key Tips: Alt opens the key tips, H selects Home, O opens Format, and A runs AutoFit Row Height. The selected rows should expand or shrink to fit their contents.
- Use the ribbon if you prefer clicking. With the rows still selected, choose Home > Format > AutoFit Row Height. This runs the same adjustment as the keyboard sequence. If the ribbon is collapsed, open or expand the Home tab first so the Format menu is available.
- Use the row boundary for a quick mouse adjustment. Move the pointer to the line between two row numbers in the selected range. When it becomes the row-resize pointer, double-click the boundary. Excel autofits the selected row or rows. If you have not selected a group, double-click the boundary for the individual row you want to adjust.
- Check the result at normal worksheet zoom. Confirm that the last line of wrapped text and any taller values are visible. If the row is still too short, see whether Wrap Text is enabled, whether the cells are merged, and whether the row has a manually fixed height; the troubleshooting section covers these cases.
- Repeat for other areas as needed. AutoFit works on the rows you select, not automatically on every row in the workbook. Select another range and repeat the shortcut, ribbon command, or boundary double-click wherever content has changed.
Common Mistakes
- Holding the keys together. Alt, H, O, A is a sequence of ribbon key tips. Press each key after the previous one; it is not a four-key chord such as Ctrl+Shift+something.
- Selecting a cell in the wrong row. The command affects the selected rows. Before using it, check that the row numbers or cells highlighted on the sheet cover the content you intend to fix.
- Expecting row height to solve a column-width problem. AutoFit Row Height adds vertical space. If long text is running across blank cells or is cut off horizontally, widen the column or turn on Wrap Text, then autofit the row.
- Forgetting that hidden rows stay hidden. Autofit does not unhide a row. If a row seems not to have changed, check whether its row number is hidden between neighboring row numbers, then unhide it separately.
- Expecting merged cells to autofit reliably. Excel may not calculate an appropriate height for text in merged cells. The command can leave text clipped or produce an unsuitable height, so merged layouts may need a manual adjustment.
- Assuming every selected row must have the same height. Excel calculates each row from its own contents. A group of selected rows can end up with different heights, which is usually the intended result.
Tips
- Turn on Wrap Text before autofitting long notes. Select the relevant cells and choose Home > Wrap Text. Once the text wraps within the column width, run AutoFit Row Height so Excel can make the additional lines visible. Changing the column width later can change the required row height, so autofit again after a major width adjustment.
- Autofit after changing the contents or formatting. Pasting longer text, changing the font size, applying a different font, or adjusting column width can alter how much vertical space a row needs. Run AutoFit again after those changes if the display looks clipped.
- Use the mouse when you only need a fast, local fix. Double-clicking a row boundary is convenient for a single row. The keyboard sequence is more practical when you are already selecting a range or want to repeat the command without moving the pointer.
- Know what the adjustment does not change. Excel changes the row height in the worksheet; it does not edit the cell values, remove line breaks, or change the column width. It also does not guarantee that every very long entry will fit: Excel has a maximum row height of 409 points.
- Use the same ribbon command on a Mac. The Windows Alt, H, O, A sequence is not the Mac equivalent. On Excel for Mac, select the rows and choose Home > Format > AutoFit Row Height, or double-click the row boundary. In Excel for the web, use the Home tab’s Format menu or the boundary method if the Windows key sequence is unavailable in your browser.
Troubleshooting
The shortcut does nothing. Confirm that you are using the Windows desktop app and pressing the keys one after another. On some keyboards or in some desktop setups, the first Alt press may not show key tips as expected. Use Home > Format > AutoFit Row Height instead; it is the same command and also helps confirm that the intended rows are selected.
The row height does not change, but the text is still cut off. Check for a fixed height: drag the row boundary downward temporarily, or open Home > Format > Row Height and enter a larger value. Then try AutoFit again. Also check that the row is not hidden and that the content is in the row you selected. A manual row height can be replaced by AutoFit, but a hidden row must be unhidden first.
Only one line appears even though the cell contains a paragraph. Select the cell or cells and turn on Home > Wrap Text. If the column is too wide for wrapping to occur, reduce its width or insert a line break where appropriate, then autofit the row. Text that visually spills into empty cells is not necessarily wrapped text.
A merged cell still clips after autofitting. AutoFit does not work reliably for merged cells. As a practical workaround, unmerge the cells if the sheet design allows, wrap the text, and autofit the row. If the merge must remain, adjust the row height by dragging its boundary or use Home > Format > Row Height to enter a suitable value. Check the printed or exported view too if the sheet is intended for sharing.
The row becomes extremely tall or stops growing. Look for repeated line breaks, an unusually large font, or a very long wrapped entry. Excel’s row-height limit is 409 points, so content beyond that may not all display in one row. Consider widening the column, splitting the text across rows, or placing lengthy notes in a separate area.
Frequently Asked Questions
What is the shortcut to autofit row height in Excel?
In Excel for Microsoft 365 on Windows, select the rows and press Alt, H, O, A in sequence. This opens Home > Format > AutoFit Row Height through ribbon Key Tips.
Is Alt+H+O+A pressed all at once?
No. Press and release each key in order: Alt, H, O, then A. It is a sequence of menu and ribbon key tips, not a simultaneous shortcut chord.
How do I autofit every row in a worksheet?
Select the entire sheet using the Select All button at the top-left corner between the row and column headings, then run AutoFit Row Height from the ribbon or use the Windows key sequence. This can make many rows taller, so review the sheet afterward.
What is the row-height shortcut on Mac?
The Windows Alt, H, O, A sequence is not the Mac shortcut. Select the rows and use Home > Format > AutoFit Row Height, or double-click a row-header boundary.
Does autofit work with wrapped text?
Yes. Wrap the text first with Home > Wrap Text, then autofit the row. Excel adjusts its height to show the wrapped lines, provided the cell is not affected by a merged-cell limitation or the maximum row height.
Can I autofit row height in Excel for the web?
Use the Home tab’s Format menu and choose AutoFit Row Height, or double-click the boundary below the row number. Ribbon key-tip behavior can vary with the browser, so the Windows desktop sequence is not the most dependable method in the web app.
Related
- Find and Replace Tab Names in Excel: What Actually Works
- Excel Fill Down Shortcut: Use Ctrl+D to Copy a Column
- Fill an Excel Column With Weekday Dates Automatically
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Convert Contact List to Excel: A Step-by-Step GuideTo convert a contact list to Excel, export it from your contacts app as a CSV file, then…
- How to Import Contacts in Outlook From ExcelTo import contacts from Excel into Outlook, arrange each person on a separate row, save the worksheet as…
- How to Insert a Black Line in WordTo insert a black line in Word, type three hyphens on a blank line and press Enter; Word…
- How Excel Goal Seek Works: Steps, Examples, and LimitsExcel Goal Seek works backward from a formula result: you specify the result you want, and Excel adjusts…
- XLOOKUP in Google Sheets: Formula, Examples & TipsGoogle Sheets has an XLOOKUP function for finding a value in one range and returning the corresponding value…
- Excel You Can’t Paste This Here: Causes and Fixes ExplainedExcel’s “You can’t paste this here” message usually means the destination does not match the copied cells or…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.