How to Wrap Text in Excel VBA?

In this post, you will learn how to wrap text in Excel VBA with some examples showing how to apply them in your excel spreadsheet.

Wrapping Text using VBA

To wrap the text in VBA, you can use Range.WrapText Property of the Range object.

Wrapping Text

Code:

Worksheets("Sheet1").Range("A1").WrapText = True

To wrap a range of cells

Code:

Range("A1:A10").WrapText = True

Disabling Wrapping in a Cell using VBA

To disable Wrapping.

Code:

Range("A1").WrapText = False

Disabling Wrapping in An Entire Worksheet

To disable wrapping in an Entire Worksheet,

Code:

Sub DisableWrapText()
 Cells.WrapText = False
End Sub

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn how to Find Blank cells in excel so that you can remove or delete the blank cells form...
In this article, you’ll learn what is a Gauge Chart in Microsoft Excel. Also, you will learn how to add...
Microsoft Excel provides a shortcut for the users to move columns in excel using two different ways – using Shift...