XL: Counting the Number of Characters in a Text BoxID: Q95628
|
In Microsoft Excel, you can count the number of characters in a text box by using the TEXT.BOX function in a macro.
An undocumented feature of the TEXT.BOX function is that it returns
the number of characters in the text box. Carriage returns are also
counted as characters. The following macro will display the number of
characters in a selected text box in an Alert dialog box.
The macro is as follows (starting in cell A2 of the macro sheet):
A2: =SELECTION()
A3: =TEXT.BOX("",A2,11000)
A4: =ALERT("There are "&A3&" characters in "&A2)
A5: =RETURN()
"Microsoft Excel User's Guide 1," version 4.0, pages 282-283
"Microsoft Excel Function Reference," version 4.0, page 432
Additional query words: 4.00a limit
Keywords : kbmacro
Version : WINDOWS: 3.0, 4.0, 4.0a, 5.0; MACINTOSH: 3.0, 4.0, 5.0
Platform : MACINTOSH OS/2 WINDOWS
Issue type : kbhowto
Last Reviewed: March 30, 1999