Number to words literal

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I need a funtion to convert Number to words literally, I mean 1241 (One Two
four one)

I found many examples for currency but I need literal every number to word.

Thanks in advance.
 
just wondering - can you use use excel's text to columns feature to split
your numbers into individual cells, use the currency examples you found to
convert each number to text, then concatenate the resulting strings back
together?

or, once you split the number, use a macro w/a case statement to convert the
numbers to words - as long as there would only be 10 cases (0-9), then
concatenate the strings back together?
 
Hi

Thanks but is not literal, I need for example if the number is 7648 I need
Six four eight. The common is Six hundred... I dont' need that just every
number as is.

Thanks.
 
change the argument data type if you need to.

Function Words(Arg As Long) As String
For i = 1 To Len(CStr(Arg))
Select Case CInt(Mid(Arg, i, 1))
Case 1: Words = Words & "One "
Case 2: Words = Words & "Two "
Case 3: Words = Words & "Three "
Case 4: Words = Words & "Four "
Case 5: Words = Words & "Five "
Case 6: Words = Words & "Six "
Case 7: Words = Words & "Seven "
Case 8: Words = Words & "Eight "
Case 9: Words = Words & "Nine "
Case 0: Words = Words & "Zero "
End Select
Next i

Words = Trim(Words)

End Function
 
Added a routine to Bob's ..

' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function

Function NumWord(x)

For i = 1 To Len(x)

If i < 2 Then
NumWord = GetDigit(Mid(x, i, 1))
Else
NumWord = NumWord & " " & GetDigit(Mid(x, i, 1))
End If
Next i

End Function

Use the above two functions. The first one (GetDigit) is by Bob Phillips.

A1 = 123
usage:
=numword(A1)


Mangesh
 
Mangesh

Sorry for not answer you, this exactly what I need. I really appreciate your
time.

God bless.
 
JCP said:
Hi

I need a funtion to convert Number to words literally, I mean 1241 (One Two
four one)

I found many examples for currency but I need literal every number to word.

Thanks in advance.
 
JCP said:
Hi

I need a funtion to convert Number to words literally, I mean 1241 (One Two
four one)

I found many examples for currency but I need literal every number to word.

Thanks in advance.
 
JCP said:
Hi

I need a funtion to convert Number to words literally, I mean 1241 (One Two
four one)

I found many examples for currency but I need literal every number to word.

Thanks in advance.


Vijay Chary,
India
26-11-2006

Hi JCP !,
You could write a Function or a Macro In VBA That will
Compose in words (literal) any given number in words as you have shown in
your posting.

Prepare a worksheet in the workbook with a word for each digit in one column.
(e.g.) one, two, three etc. in column A. The Macro (or Function) chooses
the contents of the nth cell in column A. Then the Words are concatenated to
give you
(e.g.) One Two Four One if you Input 1241.

You are Welcome !
 
hi mangesh, i'm not a professional user of excel, but am facing the same
problem... however i dont know where to paste this funtion that you wrote,
can you please guide me through, step by step. would really appreciate your
help.
thanks.
reply on my e-mail (e-mail address removed)
 
Back
Top