TEXT Formula

  • Thread starter Thread starter Buckeyefan
  • Start date Start date
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?
 
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.
 
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
 
Back
Top