The Excel Wrap Text Option is Not Working for Merged Cells – 5 Solutions

The dataset showcases Quotes and the corresponding Authors. Each quote covers 3 cells and the text isn’t completely displayed. Wrap the text after merging those cells.

Dataset Excel Wrap Text Not Working Merged Cell

 

Issue:

  • Select a quote (e.g. B5:D5).
  • Click Merge & Center.
  • Select Wrap Text in Alignment.

Issue Identification

Alternatively, you can use the Format Cells option  (press CTRL  + 1 to open the Format Cells dialog box). Go Alignment and check  Wrap Text and Merge Cells.

Issue Identification

This is the output.

Issue Identification

Note: you cannot merge all the cells containing your dataset.You have to select the adjacent cells to merge.

If you repeat the process in the cells below, you’ll get the following output.

Issue Identification

  • Autofit the row height: click AutoFit Row Height in Format.

Issue Identification

You’ll get the following output (the Wrap Text option is not working over the merged cells: Row 5, 8, and 9).

Excel Wrap Text Not Working Merged Cell Issue Identification

 


Solution 1 – Adjust the Row Height and Column Width Manually

  • Select any cell and go to the row number. Drag down your cursor.

Adjust Row Height and Column Width Manually

  • You can also enter the row height by selecting Row Height in Format.

Adjust Row Height and Column Width Manually

  • Enter 32 as the row height.

Excel Wrap Text Not Working Merged Cell Adjust Row Height and Column Width Manually

Both the Wrap Text and Merge Cells options are working well.

Excel Wrap Text Not Working Merged Cell Adjust Row Height and Column Width Manually

Adjust the column width if you have merged cells in columns.


Solution 2 – Unmerge Cells and Then Wrap theText

  • Select Unmerge Cells in Merge & Center.

Unmerge Cell Then Wrap Text

This is the output.

Unmerge Cell Then Wrap Text

  • Select the cell range and click Wrap Text.

Unmerge Cell Then Wrap Text

  • Choose AutoFit Row Height.

Unmerge Cell Then Wrap Text

This is the output.

Unmerge Cell Then Wrap Text

Read More: Excel Auto Fit Row Height for Wrap Text


Solution 3 – Change the Alignment Before Merging Cells

  • Select the unmerged cells, and choose Format Cells.

Excel Wrap Text Not Working Merged Cell Change the Alignment Before Merging Cells

  • Go to Alignment and in Horizontal, choose Center Across Selection.
  • Check Wrap text.

Excel Wrap Text Not Working Merged Cell Change the Alignment Before Merging Cells

  • Autofit cells.

This is the output.

Excel Wrap Text Not Working Merged Cell Change the Alignment Before Merging Cells


Solution 4 – Insert a Line Break 

  • Place the cursor before the hyphen and press ALT + ENTER to insert a line break.

Excel Wrap Text Not Working Merged Cell Insert Line Break

This is the output.

Insert Line Break

  • Autofit cells.

Excel Wrap Text Not Working Merged Cell Insert Line Break


 Solution 5 – Using a VBA Code 

 

Using the VBA Code

  • Click Developer > Visual Basic.

How to Insert VBA Code

  • Go to Insert > Module.

How to Insert VBA Code

Enter the following code.

Sub MergeWrap_VBA()
Dim rn As Long, Mrow As Long, ERow As Long, MCol As Long
Dim cn As Long, n As Long, rh As Single, mr As Long
Application.DisplayAlerts = False
Sheets("Using VBA").Copy After:=Sheets(Sheets.Count)
On Error Resume Next
ActiveSheet.Name = "Outupt Using VBA"
Cells().WrapText = True
Rows.AutoFit
MCol = Cells(1, 1).End(xlToRight).Column
Mrow = Cells(Rows.Count, 1).End(xlUp).Row
For rn = Mrow To 2 Step -1
    If Cells(rn, 1).Value = "" Then
        If ERow = 0 Then ERow = rn
       ElseIf ERow > 0 Then
        rh = Rows(r).RowHeight
        n = ERow - rn + 1
        If n > 0 Then Rows(rn & ":" & ERow).RowHeight = h / n
        For cn = 1 To MCol
               For mr = ERow To rn Step -1
                If Cells(mr, cn).Value = "" Then
                       Range(Cells(mr, cn), Cells(mr - 1, cn)).MergeCells = True
                   End If
            Next
        Next
        ERow = 0
    End If
Next
Application.DisplayAlerts = True
With Worksheets("Outupt Using VBA").Columns("B")
 .ColumnWidth = .ColumnWidth * 2
End With
End Sub

Excel Wrap Text Not Working Merged Cell Using the VBA Code

The variables are declared. The code generates a copy of the input into a new sheet. The WrapText is assigned to True to wrap the texts. The Range.End property is used to return the maximum column and row number. The For loop returns the output. The Column.Width property  increases the width of column B.

Things to Change While Using the Code:

  • Enter the active sheet name (“Using VBA”).
  • Change the output sheet: “Output Using VBA”.
  • Define the column to wrap the text.

Run the code (press F5 or Fn + F5), you’ll see the following output.

Excel Wrap Text Not Working Merged Cell Using the VBA Code

Read More: [Fixed] Wrap Text Not Showing All Text in Excel


Download Practice Workbook


 

Related Articles


<< Go Back to Wrap Text | Text Formatting | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdul Kader
Md. Abdul Kader

MD. ABDUL KADER is an engineer with a talent for Excel and a passion for VBA programming. To him, programming is like a time-saving wizard, making data manipulation, file handling, and internet interactions a breeze. His skill set extends to SWM, GIS, RS, and SPSS. He holds a B.Sc in Urban & Regional Planning from Chittagong University of Engineering and Technology and has shifted to become a content developer. In this role, he crafts technical content centred around... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo