Covnvert numbers to single words

[Solved/Closed]
Report
Posts
2
Registration date
Thursday November 22, 2012
Status
Member
Last seen
November 23, 2012
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
Hello,

In excel 2010 i would like to convert numers to words i.e. 123.00 (one two three point zero zero) or 1006235.23 (one zero zero six two three five point two three) and would be grateful for any assistance in this matter. Thank you in advance


3 replies

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
802
perhaps many ways.
first create a table any empty space I have doen it in in column K and L as follows

1 ONE
2 TWO
3 THREE
4 FOUR
5 FIVE
6 SIX
7 SEVEN
8 EIGHT
9 NINE
0 ZERO

suppose the number is in A!

try this macro

Sub TEST()
Dim r As Range, j As Long, k As Long
Dim cfind As Range, m As Long
Dim nrtable As Range, x As String
Set r = Range("A1")
Set nrtable = Range(Range("K1"), Range("K1").End(xlDown).Offset(0, 1))

j = Len(r)
For k = 1 To j
m = Mid(r, k, 1)
'MsgBox m
Set cfind = nrtable.Cells.Find(what:=m, lookat:=xlWhole)
x = x & " " & cfind.Offset(0, 1)
Next k
'MsgBox x
x = Trim(x)
r.Offset(0, 1) = x
End Sub


the result will be in B1

now if the number table is not in K and L change the code statement
Set nrtable = Range(Range("K1"), Range("K1").End(xlDown).Offset(0, 1))

if the number is not in A! correct the code statement
Set r = Range("A1")

you can even change this statement as
set r=selection
and select the number and run the macro
modify to suit you
Posts
2
Registration date
Thursday November 22, 2012
Status
Member
Last seen
November 23, 2012

Thank you. Works perfectly. How do i then insert say point zero zero? Regards
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
802
question not clear. if you type 123 or 123.00 this is entered onlly as 123. no decimal point shown and so in words also no decimal will be shown
but if you have decimal point in A1 like 123.25 then make a small modification

in the third line of macro
change
m as long
to
m as variant
now run the macro
if it is ok then save the file