counting digits in a cell

DrJimmy

Registered User.
Local time
Today, 15:10
Joined
Jan 10, 2008
Messages
49
Hi,

Does anyone know of a quick way of counting the number of digits within a given cell ref?

Cheers
 
len(row(reference))

Is that what you are looking for?
 
Doesn't seem to give me the number I'd expect. When I apply it to a cell ref where the contents are 24.12 it says 16 is the answer. I'd expect eithe 4 or 5?

Cheers
 
Just use:

Len(Reference)

this will return the length, including the decimal.

To test, if your entry of 24.12 is in "B3" just enter in some other cell as:
= Len(B3)
you will get 5

You can use this Len() function in VBA also.
 
That's done the trick. I tried it before and for some reason it didn't bring back the expected result. Oh well....!

Cheers
 
I was thinking just the Len() would to too easy ... LOL

Glad you found it!
 
Yeah, the "row" that you included would cause a problem with the Len() function.

Glad to help.
 
I interperted it is he as looking for the number of didgets on a full cell reference...
i.e.
A1 = 1 didget
AA1 = 1 didget
AA 10000 = 5 didgets.
 

Users who are viewing this thread

Back
Top Bottom