Skip to main content

Range.WrapText property

Table of contents
  1. Syntax
  2. Remarks
  3. Example

Returns or sets a Variant value that indicates if Microsoft Excel wraps the text in the object.

Syntax

expression.WrapText

expression A variable that represents a Range object.

Remarks

This property returns True if text is wrapped in all cells within the specified range, False if text is not wrapped in all cells within the specified range, or Null if the specified range contains some cells that wrap text and other cells that don't.

Microsoft Excel will change the row height of the range, if necessary, to accommodate the text in the range.

Example

This example formats cell A1 on Sheet1 so that the text wraps within the cell.

Worksheets("Sheet1").Range("A1").Value = "This text should wrap in a cell."
Worksheets("Sheet1").Range("A1").WrapText = True

Leave a comment

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

Format your code: <pre><code class="language-vba">place your code here</code></pre>