TEXT Formula

B

Buckeyefan

I am using a text formula in a Macro to convert numbers to text. Some of the
numbers will be 5 digits and some will be 6 digits. How do I count the
number of characters using the text formula?
 
A

Alan

The LEN formula returns the number of characters in a cell, for instance if
you have NEW YORK 22 in A1,
=LEN(A1) will return 11 which consists of 7 letters, 2 numbers and 2 spaces.
Regards,
Alan.
 
J

jaf

Sub test()
MyRange = Len(Range("$a$1")) 'a1=123456
MyValue = 123456
Debug.Print MyRange, Len(MyValue)
End Sub

It counts the decimal point also. So 123.456 len()=7

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top