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 = TrueTo wrap a range of cells
Code:
Range("A1:A10").WrapText = TrueDisabling Wrapping in a Cell using VBA
To disable Wrapping.
Code:
Range("A1").WrapText = FalseDisabling Wrapping in An Entire Worksheet
To disable wrapping in an Entire Worksheet,
Code:
Sub DisableWrapText() Cells.WrapText = False End Sub
