TEXTWIDTH Function

Office 2013 and later

Last modified: March 09, 2015

Applies to: Office 2013 | Visio 2013

In this article
Syntax
Remarks
Example

Returns the width of the composed text in a shape.

TEXTWIDTH(shapename!TheText[,maximumwidth])

Parameters

Name

Required/Optional

Data Type

Description

shapename!theText

Required

String

A reference to the cell named TheText in the target shape. shapename! is the name of the shape from which you want to retrieve the text.

maximumwidth

Optional

Numeric

The maximum width of the text block.

Return Value

String

The TEXTWIDTH function is commonly used to adjust the width of a shape to fit the text it contains.

If sheetN! is omitted, the default shape is the current shape.

If maximumwidth is specified, the result is the longest line of text that fits within maximumwidth. If maximumwidth is omitted, the result is the total width of the text.

TEXTWIDTH(TheText)

Returns the total length of the text in the current shape.

Show: