How to Automatically Adjust Excel Row Height for Wrapped Text
Question details
The user needs to automatically resize row heights in Excel to accommodate wrapped text, specifically seeking solutions for regular cells and navigating the limitation where AutoFit fails on merged cells.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Formatting a spreadsheet where cells contain long strings of text that need to be fully visible without manually resizing each row.
- Observed behavior
- Excel can automatically adjust row height for wrapped text in regular, unmerged cells, but the native AutoFit functionality fails to work reliably on merged cells.
Ensure that the 'Wrap Text' feature is enabled for your target cells, as AutoFit cannot calculate multi-line row heights if the text is restricted to a single line.
Use AutoFit Row Height for Unmerged Cells
This is the standard and recommended method for automatically expanding row height to fit text in regular, unmerged cells.
Click and drag to highlight the rows or specific cells containing the text you want to fit.
Navigate to the 'Home' tab on the Excel ribbon and click the 'Wrap Text' button located in the Alignment group.
Go to the 'Home' tab, click on 'Format' in the Cells group, and select 'AutoFit Row Height' from the dropdown menu. Alternatively, you can simply double-click the bottom boundary of the row heading to instantly AutoFit.

Use a VBA Macro for Merged Cells
Because Excel's native AutoFit does not support merged cells, you must use a custom VBA macro to calculate and apply the appropriate row height.
Effortlessly Adjust Row Heights with WPS Spreadsheet
WPS Office provides an intuitive and highly compatible spreadsheet tool to manage text formatting and AutoFit row heights seamlessly, offering a perfect alternative for handling your data.
- 1. Open your workbook in WPS Spreadsheet: Launch WPS Office on your device and open your existing spreadsheet document.
- 2. Highlight the text cells: Select the rows or unmerged cells that contain the long text you wish to format.
- 3. Enable Wrap Text: Click on the 'Wrap Text' icon under the Home tab to ensure text flows to multiple lines.
- 4. AutoFit the row height: Click 'Row and Column' in the Home tab and choose 'AutoFit Row Height' to instantly adjust the size to fit your text perfectly.

Frequently Asked Questions
Why isn't AutoFit row height working on my merged cells in Excel?
Excel's built-in AutoFit feature is intentionally designed not to support merged cells. To adjust row heights for merged cells, you must manually drag the row boundary to the desired height or implement a custom VBA macro to calculate it automatically.
How do I ensure text wrapping is active before applying AutoFit?
Select your cells, navigate to the Home tab on the Excel ribbon, and click 'Wrap Text' in the Alignment group. The row will only AutoFit multiple lines of text if this setting is actively turned on.
Is there a keyboard shortcut to AutoFit row height in Excel?
Yes. After selecting the rows you want to adjust, press Alt + H, then O, and finally A sequentially on your keyboard. This sequence triggers the AutoFit Row Height command directly from the ribbon.




