TEXTWIDTH Function
Returns the width of the composed text in a shape.
Syntax
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
Remarks
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.
Example
TEXTWIDTH(TheText)
Returns the total length of the text in the current shape.