Yes, you can automatically set the row height to fit the content in each cell using the "Double-click to AutoFit" feature or a keyboard shortcut. This ensures that no text is clipped and the data is always perfectly readable without manual adjustments.
What You'll Need
- A computer with Microsoft Excel installed (2010, 2013, 2016, 2019, 365, or Excel for the Web).
- A spreadsheet containing cells with text that is currently overflowing or wrapped.
- A mouse or trackpad for clicking, or a keyboard for shortcuts.
Step-by-Step
- Select the range of rows. Click on the row number on the left side of the spreadsheet. To select multiple consecutive rows, click and drag down. To select non-consecutive rows, hold the Ctrl key (Windows) or Command key (Mac) and click each row number individually.
- Double-click the bottom border of a selected row. Move your mouse cursor over the bottom border of any one of the selected row numbers. The cursor should change from a thick white cross to a double-headed arrow. Double-click the mouse button. Excel will analyze the tallest cell content in that range and automatically resize the rows to fit.
- Use the keyboard shortcut for a single row. If you only need to adjust a single row, place your cursor inside any cell within that row. Press the Alt key (Windows) or Option key (Mac), hold it down, and press Enter. Excel will automatically adjust the height of the active row to fit its contents.
- Use the keyboard shortcut for multiple rows. To quickly adjust the height of multiple rows at once, select the range of rows you want to change. Press Alt + Enter (Windows) or Option + Enter (Mac). This command applies the "Best Fit" height to the selected area.
- Check for wrapped text. The auto-formatting feature works best when the text is set to wrap. If the text in the cell is not wrapped, it will extend horizontally and may appear cut off at the bottom of the cell. To enable wrapping, select your cells, go to the Home tab on the ribbon, and click the Wrap Text button in the Alignment section.
Common Mistakes
The most frequent error users encounter is that the row height does not change even after double-clicking. This usually happens for one of three reasons. First, the cells may not actually contain visible text; sometimes users copy and paste data that has hidden formatting or carriage returns that are not immediately apparent. Second, the row may have a specific fixed height set manually. If you previously dragged a row border to a specific size, Excel will not automatically override that specific measurement unless you delete the manual height setting. Third, if the text is not wrapped, the row will remain at its minimum height, and the text will spill over into adjacent columns rather than expanding the row.
Tips
When working with large datasets, using the double-click method on the row headers is often faster than trying to adjust individual cells. If you are working with a dataset that has hundreds of rows, selecting the entire column (clicking the column letter) and then double-clicking the bottom border of the header row is a quick way to fit all the data in that column at once. Remember that the auto-fit function considers the tallest piece of content within the selected range, so if you have a single cell with a very long date string or a URL, it will dictate the height for the entire group of rows.
Troubleshooting
If the row height does not automatically adjust when you double-click the border, check the cell contents for hidden characters. Sometimes, text pasted from the web contains invisible line breaks or spaces that force the row to stay large even if it looks empty. To fix this, select the specific cell and press the Ctrl + Shift + Space (Windows) or Command + Shift + Space (Mac) shortcut to select all content in that cell. Then, press Backspace or Delete to remove the hidden characters and try the auto-fit again.
If the row is set to a specific height and refuses to change size, you may need to reset the row height to its default value. Right-click on the row header and select Row Height. A dialog box will appear. You can type a generic number like 0 to reset it, or simply click the OK button if you want to keep the current setting. If the row is locked or protected, you must unprotect the sheet in the Review tab first. To do this, go to the Review tab, click Unprotect Sheet, perform the auto-fit action, and then protect it again if necessary.
Frequently Asked Questions
Does the auto-fit feature work on merged cells?
Yes, the auto-fit feature works on merged cells. However, it will adjust the row height based on the content of the merged cell. If the merged cell spans multiple rows, the top row will be expanded, and the other rows will remain at their current height unless they are also selected.
Why does the row height stay small even if I type more text?
If the row height stays small, it is likely because the Wrap Text setting is disabled. Without wrapping, text will run horizontally across the cells rather than expanding the row vertically. Enable Wrap Text from the Home tab to force the row to grow as you type.
Can I set a minimum height for auto-fit rows?
No, the auto-fit feature in Excel is designed to be dynamic. It will make the row as short as possible to fit the content. If you need a minimum height, you must manually set the row height after the auto-fit has occurred.
Does this work in Excel for the Web?
Yes, the auto-fit feature is available in Excel for the Web. You can select the rows, right-click, and choose AutoFit Row Height, or select the cells and press the keyboard shortcut described above.
What if the row height is set to 0?
If a row height is set to 0, it will appear blank. To fix this, right-click the row header and choose Row Height. Enter a standard height like 15 or 20 to make the row visible again.