How to Wrap Text in Excel (Wrap, Unwrap, Fix Issues)

Wrapping text in Excel means displaying all the contents of a cell over multiple lines. It comes in handy when dealing with long text entries. Wrap text prevents long numbers, codes, or URLs from being cut off.

In this tutorial, you will learn everything about wrapping text in Excel.

In the following dataset, we want to wrap the texts in the Product Description column as they are not visible properly. The following overview GIF shows how the wrap text works in Excel. Select the cells, go to the Home tab, and click the Wrap Text option.

Wrap Text Overview in Excel

In this blog post, you will learn how to wrap text in Excel

– Using Wrap Text Option
– Using Format Cells Dialog Box
– Using Keyboard Shortcuts
– Using AutoFit Column Width
– Inserting Line Break
– Using Excel VBA

You can also learn

– to wrap texts in merged Cells
– to unwrap texts
– possible reasons and solutions when Wrap Text feature does not work

While writing the article, I used Microsoft 365. Don’t worry! The Wrap Text feature is available from Excel version 2007 or later.


What Is Meant by Text Wrapping?
Why Use Text Wrapping?
Wrap Text Automatically
    ⏵ Using Wrap Text Option
    ⏵ Using Format Cells Dialog Box
    ⏵ Using Keyboard Shortcuts
    ⏵ Using AutoFit Column Width Options
Wrap Text Manually
    ⏵ Inserting Line Break
Wrap Text Using VBA
Wrap Text in Merged Cells
Wrap Text on Mac
Unwrap Text
Wrap Text Feature Not Working
Things to Keep in Mind


What Is Meant by Text Wrapping?

In Excel, wrap text means displaying the contents of a cell on multiple lines rather than one single line. It refers to making long sentences or words fit inside a cell without getting cut off. Typically, text in a cell only shows in one line. However, we can display several lines within the same cell by wrapping text. Instead of making the cell bigger, wrapping a text fits the cell contents in a better way.

Text wrap meaning

Notes
Technically, the Wrap Text feature keeps the column width consistent and adjusts the row height of a cell accordingly.

Why Do We Need to Wrap Text in Excel?

We need to wrap text in Excel-

  • to view all the information within a cell in case of long sentences.
  • to prevent any piece of information from being overlooked behind other cells.
  • to improve the look of your Excel document.
  • to reduce the number of pages printed while printing the spreadsheet.

How To Wrap Text Automatically in Excel

1. Using Wrap Text Option from Home Tab

We can easily and automatically wrap text in Excel cell by using the Wrap Text option.

  • First, select range D6:D13 and go to Home.
  • Later, click on Wrap Text from the Alignment group.

Selecting cells and choosing wrap text option

Finally, we will be able to make the text automatically wrap around in Excel.

Text wrapped in the selected cells


2. Using Format Cells Dialog Box

Applying the Format Cells needs more steps than wrapping texts using the Wrap Text option. However, using the Format Cells for wrapping text will save us time when we need to apply other formatting besides wrapping.

  • To begin, select the D6:D13 range and press Ctrl+1.

Press Ctrl+1 after selecting the cells

Due to this, the Format Cells window will appear.

  • Next, go to the Alignment tab.
  • Check Wrap Text from Text Control and hit OK.
Notes
Sometimes, the Wrap Text checkbox is filled with a solid rectangle box. That means some cells among selected cells are already wrapped. And some cells are not wrapped.

Choose wrap text option from alignment tab

As a result, we will see an output like the following one.

Text wrapped in the selected cells


3. Using Keyboard Shortcut

We can easily use the wrap text command using shortcut key in Excel.

  • Select the D6:D13 range and press Alt+H.

Select cells, press Alt and then H

  • After that, press W to apply Wrap Text.

Press w

Finally, we will see an output like the below one.

Text wrapped in the selected cells


4. Using AutoFit Column Width Option

Using the AutoFit Column Width option, we can easily display the whole text inside a cell. To do so,

  • Select cells where you want to wrap text. We selected D6:D13.
  • Go to the Home tab.
  • Expand Format option from Cells group.
  • Select AutoFit Column Width.
Choosing Autofit Column Width Option

Click the image to get a better view

You will see that the columns are automatically expanded to display the entire text’s contents.

Columns Autofitted

Click the image to get a better view

Notes
The maximum limit of column width is 255. So, you cannot use this method for viewing text that exceeds this limit.

How To Wrap Text Manually in Excel

Insert Line Breaks to Manually Wrap Text

You can manually wrap text by inserting line breaks. We do not recommend applying this idea often because it will take longer than other methods.

  • Select a cell and go to the Formula bar.
  • Place the cursor where you want to insert a line break.
  • Press Alt+Enter.

Place cursor and press Alt+Enter

  • After inserting the intended line breaks, press Enter.

Now, if you select cell D6, we will see the Wrap Text feature is enabled.

Wrap Text Option Activated Automatically

We can apply the same format as D6 to other cells using Format Painter. This will save time and effort.

  • Select cell D6.
  • Go to Home >> click on Format Painter.

Selecting Format painter option

  • Select the range D7:D13 to apply the same format as D6.

Select Range to Paint Format

Finally, we will see the result. Thus, we have applied the Wrap Text feature manually.

Line break added

Following the same procedure, you can also write a paragraph in an Excel cell. Turn on the Wrap Text option, type the text in a cell, and insert a line break where necessary.

Notes

Place the cursor where a new line starts to remove the manual line break for a cell. Later, press Backspace to remove line breaks one by one.

If you ever feel like removing these Link breaks at a time, select the intended cells and press Ctrl+H. As a result, the Find and Replace window will appear. Later, place your cursor to Find what section and press Ctrl+J. Next, keep the Replace with section empty and click on Replace all.


Differences Between Wrap Text Feature and Line Breaks

There is an exciting difference between the Wrap Text feature and Line Breaks, which you may miss noticing.

To demonstrate the difference, we are considering two cells containing long texts. Assume in cell B6, we have applied the Wrap Text feature. In contrast, in cell E6, we have inserted link breaks.

Applying the Wrap Text feature directly in a cell lets you see the whole text in a single line within the formula bar.

Characteristic of Wrap Text Option

Click the image to get a better view

Applying the Line Breaks in a cell will not let you see the whole text within the formula bar.

Characteristic of Line Break

Click the image to get a better view

Notes
If you want to see the whole content after applying the Line Breaks in a cell, you must expand the formula bar.

Expanding formula bar to see whole text with line break

Click the image to get a better view


How to Wrap Text Using Excel VBA

We will use Excel VBA wrap text property to wrap text in a cell, range, row, column, entire worksheet, etc.

1. Wrapping Text in a Cell

We will run an Excel VBA code to apply the wrap text feature within cell D6.

  • Activate the intended sheet.
  • Go to Developer and click on Visual Basic.

Selecting Visual basic Option

Due to this, the VBA Editor window will appear.

  • Click on Insert followed by Module.

Inserting Module

  • Insert the following code in the module and Run.
Sub WrapCell()
    Cells(6, 4).WrapText = True
End Sub

WrapCell Code

Notes

Alternatively, we can wrap text in a cell using the following code.

Sub WrapCellAlternative()
    Range("D6").WrapText = True
End Sub

As a result, we can see that the Wrap Text feature is enabled for cell D6.


2. Wrapping Text in Range

We will apply the wrap text feature in the range D6:D13 by running the VBA code.

  • First, activate the intended sheet.
  • Navigate to Developer and click on Visual Basic.

Selecting Visual Basic Option

As a result, the VBA Editor window will open.

  • Hover over Insert and click on Module.

Inserting Module

  • Insert the following code in the module and Run.
Sub WrapRange()
    Range("D6:D13").WrapText = True
End Sub

WrapRange Code

Finally, you can see that the Wrap Text feature is enabled for cell range D6:D13.

Wrapping Text in Range


3. Wrapping Text in Selected Range

We will run a VBA code to apply the wrap text feature in the Selected range.

  • To begin, select the D6:D13 range.
  • Go to Developer and click on Visual Basic.

Selecting Visual basic Option

Consequently, the VBA Editor window will open.

  • Hover over Insert and click on Module.

Inserting Module

  • Insert the code below in the module and Run.
Sub WrapSelectedRange()
    Dim selectedRange As Range
    Dim cell As Range 
    If Selection.Cells.Count = 1 Then
        Set selectedRange = ActiveSheet.UsedRange
    Else
        Set selectedRange = Selection
    End If 
    For Each cell In selectedRange
        cell.WrapText = True
    Next cell 
    Selection.Rows.AutoFit
End Sub

WrapSelectedrange Code

Lastly, you can see that the Wrap Text feature is enabled for the selected range.

Wrapping text in Selected range


4. Wrapping Text in Used Range

We will wrap text within the Used Range in the intended sheet in this context. The cells containing any values or formulas are known as the Used Range.

  • Go to Developer and click on Visual Basic.

Showing Used Ranges and selecting visual basic

Due to this, the VBA Editor window will open.

  • Hover over Insert and click on Module.

Inserting Module

  • Insert the following code in the module and Run.
Sub WrapUsedRange()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("In Used Range (VBA)")
    ws.UsedRange.WrapText = True
End Sub

WrapUsedRange Code

Selecting any cell among the Used Range will show that the Wrap Text is enabled.

Used ranges text wrapped


5. Wrapping Text in Entire Row

Here, we will run a VBA code to enable Wrap Text for the Entire Row 6.

Showing the 6th row

  • Open the VBA Editor.
  • Select Insert and click on Module.
  • Insert the following code and Run.
Sub WrapEntireRow()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("In Entire Row (VBA)")
    ws.Range("6:6").WrapText = True
End Sub

WrapEntireRow Code

Notes
Change the sheet name “In Entire Row (VBA)” in ThisWorkbook.Sheets property while using the code in your workbook.

Lastly, you can see that the Row 6 texts are wrapped.

Showing entire row is wrapped


6. Wrapping Text in Entire Column

Here, we will apply a VBA code to enable Wrap Text for the Entire Column D.

Showing the Column

  • In the Visual Basic Editor window, hover over Insert and click Module.
  • Paste the following code and Run.
Sub WrapEntireColumn()
    Range("D:D").WrapText = True
End Sub

WrapEntireColumn

Lastly, insert any long text within any cell of Column D and get the result.

Text Wrap Activated for the entire column


7. Wrapping Text in Entire Worksheet

We will present a VBA code to wrap text for entire sheet in Excel.

  • Open the VBA Editor.
  • Click on Insert followed by Module.
  • Paste the following code and Run.
Sub WrapEntireWorksheet()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("In Entire Worksheet (VBA)")
    ws.Cells.WrapText = True
End Sub

WrapEntireWorksheet Code

Selecting any cell that belongs to that sheet will show that the Wrap Text is enabled.

Select any cell and you will see wrap text enabled for that cell

Using VBA, we can also loop through all sheets in a workbook and apply Wrap Text in all sheets. To do that, use the following code.

Sub WrapAllWorksheets()
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
       Cells.WrapText = True
    Next ws
End Sub

WrapAllWorksheets code


8. Wrapping Text in Non-contiguous Range

In this part, we will enable Wrap Text for Non-contiguous Range.

Showing Non-contiguous Cells

  • Go to Developer >> Visual Basic.
  • Click on Insert >> Module.
  • Paste the following code and press Run.
Sub WrapNoncontiguousRange()
    Range("D6:D13,C16:C17").WrapText = True
End Sub

WrapNonContiguousRange Code

Finally, we can see that Wrap Text is enabled for the D6:D13 and C16:C17 ranges.

Wrap text enabled all non-contiguous cells


9. Wrapping Text in Named Range

Here, we will enable Wrap Text for a Named Range.

  • Select the D6:D13 range and type Product Description in the Name Box to create a Named Range.

Naming the selected range

  • Insert a Module in Visual Basic Editor.
  • Then, insert the following code and Run.
Sub WrapUsedRange()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("In Used Range (VBA)")
    ws.UsedRange.WrapText = True
End Sub

WrapNamedrange Code

As a result, we will see an output like the following one.

Wrap Text enabled in Cells of Named Range


How to Wrap Text in Merged Cells in Excel

In this section, we will wrap text in merged cells in Excel. You can see that cells in the Product Description column are merged.

Showing Merged Cells

Click the image to get a better view

  • Select the merged cells and right-click on them to open the context menu.
  • Click on the Format Cells.
Selecting Format Cells Option-46

Click the image to get a better view

  • Format Cells dialog box will open.
  • Click on the Alignment.
  • Check the Wrap text box under the Text control.
  • Press OK.

Selecting Wrap Text Option-47

You will see the Wrap Text option enabled but not working.

Wrap text enabled but texts not visible-48

Click the image to get a better view

We need to change the row height to make the wrapped text visible.

  • Select the cells D6:D13.
  • Go to Home > Expand Format.
  • Select Row Height under Cell Size.
Selecting Row Height Option

Click the image to get a better view

  • Set Row Height to 45 and press OK.

Setting Row Height-50

Now, you can see all the wrapped texts in merged cells.

Selected Cells row height changed-51


How Do You Wrap Text on a Mac?

On a Mac, we can wrap text by going to the Format menu after choosing the cells. Next, check the Wrap Text box and click OK.


How to Unwrap Text in Excel

We can unwrap texts in Excel using methods similar to wrapping texts.

1. Unwrap Text by Deselecting Wrap Text Option

  • Select the intended cells and go to the Home tab.
  • Next, deselect the Wrap Text option.

Deselecting wrap text option

As a result, the output will look like the below one.

Texts Unwrapped


2. Use Format Cells Window to Unwrap Text

  • To begin, choose the intended cells.
  • After that, right-click on any selected cell and choose Format Cells.
Selecting Format Cells Option

Click the image to get a better view

The Format Cells window will appear.

  • Next, go to the Alignment tab.
  • Uncheck Wrap Text from Text Control and hit OK.

Deselecting Wrap Text Option

As a result, we will see an output like the following one.

Texts Unwrapped


3. Apply a Keyboard Shortcut to Unwrap Text

  • Initially, select the desired cells and press Alt+H+W.

Select Cells and press Alt+H+W

As a result, the output will look like this:

Texts Unwrapped


4. Using Excel VBA

For using VBA to unwrap text, we must set the WrapText property to False in Excel. Assume you want to unwrap text in range D6:D13.

Go to the Developer tab and select the Visual Basic option.

Selecting Visual Basic Option

  • Insert a Module in Visual Basic Editor.

Inserting Module

  • Copy the following code and paste it into the Module.
  • Press the Run button or F5.
Sub UnwrapUsingVBA()
Range("D6:D13").WrapText = False
End Sub

UnwrapUsingVBA Code

The wrapped texts are unwrapped now.

Unwrapped Text


Why Is the Wrap Text Feature Not Working in Excel?

There are many reasons for the wrap text feature not working in Excel. However, we have listed some common reasons why the issue occurs.

Reason 1: Fixed Row Height

If you manually set the Row Height of a cell, the Wrap Text feature will not work for that cell.

To demonstrate the issue, select range D6:D13 >> go to Home >> expand Format >> click on Row Height.

Selecting Row Height Option

Click the image to get a better view

Due to this, the Row Height window will appear.

  • Choose the desired height.
  • Click OK.

Setting row height-63

Thus, we have manually set the Row Height. Now, choose the intended cells >> apply Wrap Text.

We will see that wrap text not showing all the text in cell, meaning the Wrap Text feature is not working.

Notes
It has yet to be mentioned whether the Excel VBA code given to wrap text in Selected Range will resolve the problem.

select wrap text option

However, the wrap text is cutting off words still.

Wrap text not working properly


Solution: Apply AutoFit Row Height

To overcome the situation, choose range D6:D13 >> go to Home >> expand Format >> click on AutoFit Row Height.

Applying Autofit Row Height

Click the image to get a better view

Lastly, you can see that the Auto Fit Row Height is used to wrap text in Excel cells.

Rows autofitted


Reason 2: Presence of Merged Cells

Another reason for the wrap text not working is the presence of merged cells. For example, in the image below, we applied Wrap Text to the merged cells of the Product Description column.

Wrap Text to Merged Cells

However, you can see that the texts are not visible, meaning the wrap text did not work.

Wrap text not working-69


Solution: Choose Either Wrap or Merge

Since the wrap text option does not work on merged cells, you can either apply the merging or wrap text options. You need to decide to choose one option.

However, you can apply both options with some extended steps. For that, follow the method that we explained before in this article: How to Wrap Text in Merged Cells in Excel.


Reason-3: Horizontal Alignment Set to Fill

Another reason for the wrap text not working is the horizontal alignment being set to Fill. The image below shows that the Wrap Text option is enabled. Yet the texts are not wrapped.

Wrap Text not working

Let us check the horizontal alignment of these cells. For that, select the cells and press Ctrl+1.

Press Ctrl+1 after selecting cells

This will open the Format Cells dialog box. Click on the Alignment tab. You can see in the Text Alignment section that the option for Horizontal is set as Fill.

Showing Horizontal Alignment set to Fill


Solution: Set Horizontal Alignment to General

To fix this problem, click the drop-down beside the Horizontal text alignment option and select General. Then press OK.

Setting Horizontal Alignment as General

Finally, the wrap text option is enabled with the change of horizontal text alignment.

Wrap Text Working


Which Things You Have to Keep in Mind?

While going through this article, there are a few things you should keep in mind.

  • Opening the mentioned practice workbook side by side is recommended when going through this article.
  • When working with large data, you should avoid manual wrapping.
  • If you want to use Excel VBA code, save the workbook as macro-enabled.

Download Practice Workbook


Wrap Text in Excel : Knowledge Hub


I hope the article will help you with everything you need about wrapping text in Excel. Apply wrap text in Excel using Format Cells or VBA for large datasets. Besides, you can use the Wrap Text option or shortcut keys to wrap text within a small data set quickly. Here, you also learned to handle common problems related to wrapping text. Do not hesitate to leave a comment if you have any queries.


<< Go Back to Text Formatting | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Priti
Priti

Priti Halder holds a BSc degree in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology. She has been a part of the ExcelDemy project for 6 months and during this time, she has written over 30 articles and 5 comments for the platform. Priti is currently employed as an Excel and VBA content developer and provides effective solutions to various Excel-related issues. She is passionate about expanding her knowledge of data analysis and Microsoft... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo