Wrap text

How to fit content in a cell without adjusting column width using Excel and VBA methods

METHOD 1. Wrap text using a ribbon option

EXCEL

Select the cell in which to wrap text > Home tab > Alignment group > Wrap Text

1. Select the cell in which you want to wrap text.
Note: in this example cell B2 contains a long text string that we are wrapping.
Select cell in which to wrap text

2. Select the Home tab. Select Home tab - Excel 2016

3. Click on Wrap Text, in the Alignment group. Click on Wrap Text

METHOD 2. Wrap text using cell format

EXCEL

Right-click on the cell in which to wrap text > Format Cells > Alignment tab > Check Wrap text checkbox > Click OK

1. Right-click on the cell in which you want to wrap text.
2. Select Format Cells.
Right-click on cell in which to wrap text and click Format Cells

3. Select the Alignment tab.
4. Check the Wrap text checkbox.
5. Click OK.
Select Alignment tab, check Wrap text and click OK

METHOD 1. Wrap text using VBA

VBA

Sub Wrap_Text()
'wrap text in cell B2 in worksheet named Sheet1
Worksheets("Sheet1").Range("B2").WrapText = True

End Sub

PREREQUISITES
Worksheet Names: Have a worksheet named Sheet1.
ADJUSTABLE PARAMETERS
Sheet Selection: Select the worksheet in which you want to wrap text by changing the Sheet1 worksheet name in the VBA code.
Wrap Text Cell Selection: Select the cell in which you want to wrap the text by changing the cell reference ("B2") in the VBA code.

METHOD 2. Wrap text in selected cells using VBA

VBA

Sub Wrap_Text()
'wrap text in selected cells
Selection.WrapText = True

End Sub

Explanation about how to wrap text

EXPLANATION

EXPLANATION
This tutorial explains and provides step by step instructions on how to wrap text.

Excel Methods: This tutorial provides two Excel methods that can be applied to wrap text. Both of the methods are very similar to each other, with one using the Home tab and the other using the Format cells option. The first method can be accomplished in three steps, whilst the second in five steps.

VBA Methods: This tutorial provides two VBA methods that can be applied to wrap text. The first method wraps text in the cells specified in the VBA code. The second method wraps text the selected cells.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to unwrap content in a cell using Excel and VBA methods
How to merge cells using Excel and VBA methods
How to unmerge cells using Excel and VBA methods