How to Wrap Text Automatically in Excel – 5 Methods

 

This is an overview:

5 Ways to Make Text Automatically Wrap Around in Excel


Method 1 – Wrap Text in Excel by Format Cells Option

Steps

  • Select the cell that contains text that needs to be wrapped.

Wrap Text in Excel by Format Cells Option 

  • Right-click and select Format Cells.

Wrap Text in Excel by Format Cells Option 

  • Select Text control in Alignment.
  • Check Wrap Text.
  • Click OK.

Wrap Text in the Format Cells Dialog Box

Text in D6 is wrapped.

Wrap Text in Excel by Format Cells Option 

You can change the Row height to see all the text.


Method 2 – Wrap Text in Excel Using the Ribbon

Steps

  • Select the cell that contains text that needs to be wrapped.
  • Go to the Home tab and click Wrap Text in Alignment.

Wrap Text in Excel by Using Ribbon

  • Text in D4 is wrapped.

Wrap Text in Excel by Using Ribbon

Adjust the Row height to see all the text.

Read More: How to Wrap Text in Excel Cell


Method 3 – Wrap Text Using a Shortcut

Steps

  • The text in D4 is too long to fit into one cell.

Manual Line Breaks to Wrap Text in Excel

  • Select D4 and press Alt > H > W one by one.

Manual Line Breaks to Wrap Text in Excel

  • The text is wrapped.

Manual Line Breaks to Wrap Text in Excel

Adjust the row height to see all the text.

Read More: Wrap Text in Excel Shortcut Key


Method 4 – Insert Manual Line Breaks to Wrap Text in Excel

Steps

  • Select the cell that contains the text that needs to be wrapped. Here, D6.
  • Double-click the cell to enable edit mode or press F2.
  • Place the cursor where you want to break the text.
  • Press Alt+Enter.

It will break the line into two parts.

Manual Line Breaks to Wrap Text in Excel

  • Insert more line breaks if necessary.

Manual Line Breaks to Wrap Text in Excel


Method 5 – Using VBA to Wrap Text Automatically

Use a VBA Macro to wrap text in Excel.

Steps

  • Go to the Developer tab and click Visual Basic.

Using VBA to Wrap Text Automatically

  • Click Insert and choose Module.

Using VBA to Wrap Text Automatically

  • Enter the following code:
Sub wrap_text()

  Range("D4").WrapText = True

End Sub

  • Close the window.
  • Go to the View tab > Macros > View Macros.

Using VBA to Wrap Text Automatically

  • Select the macro you created (here, wrap_text).
  • Click Run.

  • The text in D4 is wrapped.

Using VBA to Wrap Text Automatically

To wrap a range of cells, like in the dataset shown below:

Using VBA to Wrap Text Automatically

  • Enter the following code in the VBA editor:
Sub wrap_text2()

  Range("D4:D7").WrapText = True

End Sub

  • Close the VBA editor window.
  • Go to View tab > Macros > View Macros.

Using VBA to Wrap Text Automatically

  • Select the macro that you created (here, wrap_text2).
  • Click Run.

This is the output.

Using VBA to Wrap Text Automatically

To wrap a whole worksheet, use the following code:

Sub wrap_text3()
ActiveSheet.UsedRange.WrapText = True
End Sub

  • Close the window.
  • Go to the View tab > Macros > View Macros.

  • Select the macro you created (here, wrap_text3).
  • Click Run.

  • The text in the whole worksheet is wrapped.

Using VBA to Wrap Text Automatically


Download Practice Workbook

Download the practice workbook.


Related Articles


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

Get FREE Advanced Excel Exercises with Solutions!
Rubayed Razib Suprov
Rubayed Razib Suprov

Rubayed Razib, holding a BSC degree in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, serves as a devoted member of the ExcelDemy project. He has contributed significantly by authoring numerous articles and showcasing proficiency in VBA. Razib efficiently automates Excel challenges using VBA macros and actively participates in the ExcelDemy forum, providing valuable solutions for user interface challenges. Apart from creating Excel tutorials, he is interested in Data Analysis with MS Excel,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo