Formatting Issues

How to Fix Excel AutoFit Row Height Not Working in Merged Cells

Phi Hung VoPhi Hung Vo Nov 3, 2026 870 views

Question details

Users are unable to use the AutoFit Row Height feature when text is wrapped inside merged cells.

How to Fix Excel AutoFit Row Height Not Working in Merged Cells
Product
Microsoft Excel
Device & OS
not provided
Scenario
Applying wrapped text to merged cells and expecting the row height to expand automatically to fit the content.
Observed behavior
The row height remains completely unchanged, causing parts of the wrapped text to be hidden from view.
Before you start

Understand that the inability to AutoFit row heights in merged cells is a standard, expected behavior in Excel rather than a software bug. Reviewing your worksheet layout to minimize merged cells is highly recommended.

Solution 1Recommended

Unmerge Cells and Use 'Center Across Selection'

This is the best practice for horizontal headers, allowing AutoFit to function normally without losing the visual centering effect of merged cells.

By replacing merged cells with 'Center Across Selection', you avoid the formatting limitations of merging while keeping the exact same visual layout.

1
Unmerge the cells

Select the problematic merged cells and click the 'Merge & Center' button on the Home tab to unmerge them.

2
Open Format Cells

Keep the same cells selected and press 'Ctrl + 1' on your keyboard to open the Format Cells dialog box.

3
Change alignment settings

Navigate to the 'Alignment' tab. Under the 'Text alignment' section, click the 'Horizontal' drop-down menu and select 'Center Across Selection', then click OK.

4
Apply AutoFit

Double-click the bottom boundary of the row heading on the left side of the screen. The row will now automatically adjust its height to fit the wrapped text.

Unmerge Cells and Use 'Center Across Selection'
Best Practice: Using Center Across Selection prevents issues not only with AutoFit but also with sorting, filtering, and writing VBA macros.
Efficient Spreadsheet Formatting

Easily Manage Cell Layouts with WPS Spreadsheet

WPS Office provides highly intuitive formatting tools to handle cell layouts, unmerging, and row height adjustments, ensuring your data is always presented clearly without frustrating limitations.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your existing workbook containing the merged cells.
  2. 2. Unmerge Cells: Select the merged cell, go to the Home tab, and click the 'Merge and Center' button to separate the cells.
  3. 3. Apply Alignment: Right-click the cells, select 'Format Cells', navigate to the Alignment tab, and choose 'Center Across Selection' from the Horizontal alignment options.
100% format compatibility with Microsoft Excel (.xlsx) filesIntuitive formatting dialogs for quick 'Center Across Selection' setupsLightweight and incredibly fast, even with complex spreadsheet layoutsCompletely free to download and use for your daily office tasks
QA img-9

Frequently Asked Questions

Why doesn't AutoFit work on merged cells in Excel?

Microsoft programmed Excel this way because calculating the required row height for wrapped text spread across multiple columns creates logical layout conflicts, especially if different columns have varying widths. It is considered an intended software behavior.

Can a VBA macro automatically fit row heights for merged cells?

Yes, you can write a custom VBA macro that calculates the total text length and column widths to mathematically adjust the row height. However, this requires enabling macros and saving your file as an Excel Macro-Enabled Workbook (.xlsm).

Is there a keyboard shortcut to AutoFit row height?

Yes. Once you have unmerged the cells or applied 'Center Across Selection', you can select the row and press Alt, followed by H, O, and A sequentially to trigger the AutoFit Row Height command instantly.