Covnvert numbers to single words

Solved/Closed
naaur Posts 2 Registration date Thursday 22 November 2012 Status Member Last seen 23 November 2012 - 22 Nov 2012 à 04:54
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 23 Nov 2012 à 19:58
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 responses

venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 811
22 Nov 2012 à 23:27
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
naaur Posts 2 Registration date Thursday 22 November 2012 Status Member Last seen 23 November 2012
23 Nov 2012 à 06:09
Thank you. Works perfectly. How do i then insert say point zero zero? Regards
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 811
23 Nov 2012 à 19:58
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