In this article I will show you two quick and free ways to convert currency numbers into English words in Excel 2019, 2016, 2013 and other versions. Continue reading
by Alexander Frolov, updated on
In this article I will show you two quick and free ways to convert currency numbers into English words in Excel 2019, 2016, 2013 and other versions. Continue reading
Comments page 9. Total comments: 530
dear sir,
what do if i want to spell a number in rupees ?
regard,
saurav narvekar
Thanks a lot for sharing formula. Amazing...
hi guys
i cant use VBA in my company lap .
please help me to convert number to text in INR format only by suing any formulas without using macros
hai, i need to change the above coding to indian currency
done. Thank you so much
Please help me get the above coding for converting Rupees as value
i got an error. "Ambiguous name detected: SpellNumber" ..how i gonna solve this?
Thanks a lot
Mate you are a genius - thanks a million
Mate you are a genius - thanks a million
Thanks a lot. i edited the currency bit from Dollars to GHCedis & Pesewas and it worked great! so grateful.
Hi,
I'd like to convert in this format
P151.50 = One Hundred Fifty-One & 50/100 only
Thanks,
UPDATE
I was able to solve this but works only on Windows 8, 8.1, & 10 Machines only
here is the code
Option Explicit
'****************' Main Function *'****************
Function SpellNumber(ByVal MyNumber)
Dim Pesos, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion " ' String representation of amount
MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none
DecimalPlace = InStr(MyNumber, ".")
'Convert cents and set MyNumber to Peso amount
If DecimalPlace > 0 Then
Cents = Right(MyNumber, 2)
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Pesos = Temp & Place(Count) & Pesos
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Pesos
Case ""
Pesos = "No Pesos"
Case "One"
Pesos = "One Peso"
Case Else
Pesos = Pesos & " Pesos"
End Select
Select Case Cents
Case ""
Cents = " Only"
Case "1"
Cents = " & .1/100 Cent Only"
Case Else
Cents = " & " & (Cents) & "/100 Only"
End Select
SpellNumber = Pesos & Cents
End Function
'*******************************************
' Converts a number from 100-999 into text *
'*******************************************
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3) 'Convert the hundreds place
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
'Convert the tens and ones place
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
'*********************************************
' Converts a number from 10 to 99 into text. *
'*********************************************
Function GetTens(TensText)
Dim Result As String
Result = "" 'null out the temporary function value
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) 'Retrieve ones place
End If
GetTens = Result
End Function
'*******************************************
' 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
Sub test()
Dim number As Double
number = Range("A1").Value
Range("A2").Value = SpellNumber(number)
End Sub
Tried solving this.
Amount : 46,728.32
But always appears as "Forty Six Thousand Seven Hundred Twenty Eight Pesos & Thirty Two/100 Only" instead of Forty Six Thousand Seven Hundred Twenty Eight Pesos & 32/100 Only
Thank you :)
i tried to sample 123.50
result: One Hundred Twenty Three Pesos & .5/100 Only
instead of: One Hundred Twenty Three Pesos & 50/100 Only
Please help
dear sir,
what do if i want to spell a number in BTD ?
regard,
Dina Sarker
Hello, the code is great! I'm using to print checks, so I need to add the word "only" at the end of the spelled number (ie twenty one dollars only). How can I achieve this?
Hi,I need the number without the code of dollers and cents,thanks
Hi,
I need to convert a number with three digits after the decimal point, for example:
122,145 --> one hundred twenty two dollars one hundred forty five cents.
Thank you in advance.
How To convert 48000 RS in English word in M S Excle
Why do I keep on getting #Name? Send Help please
me too
thanks brother
Hello. I am wanted to enter the numbers 1 - 4 in each individual cell in an entire column. Once i insert the number and push ENTER, i want a text to replace the number based on which text i attach to that number. For example. The text for 1 is "Shut", i insert one into the cell and hit enter and it changes the value 1 to "shut
tried it and it worked:
$866.96 Eight Hundred Sixty Six Dollars and Ninety Five Cents
$866.955 Eight Hundred Sixty Six Dollars and Ninety Five Cents
but it does not round up.
it is supposed to be :
Eight Hundred Sixty Six Dollars and Ninety Six Cents
Please advise.
please disregard the previous comment. the code is working fine.
i just need to use the roundup function in excel.
You are a genius, thank you, I had the exact same problem.
Thank you for this wonderful Module. Take care.
Thanks for authentic codes. It works where codes from Microsoft gave an error message.
Best wushes!
Regards,
It working very well. Thank's
Hi, Can please I have the code without dollars and cents? thanks
Hey Mike!
do you get the code without dollars and cents
i also need this code
if you get this code please send me
i have really need this code
when i copy and paste this, it gives me errors, what am i doing wrong?
SIMPLE, LOL, YOUR MACROS WORKED FIRST TIME, NO PROBLEMS, ONLY REQUEST IS FOR A CHANGE TO 00/00...01/00...03/00 AND SO ON INSTEAD OF CENTS, GOT YOURS TO WORK 00/00 AND 01/00 TO WORK, BUT AFTER THAT, ALL IS TEXT /00. SO I DELETED CENTS ALL TOGETHER TILL I GET THE CORRECT MACROS FOR THE OO/00 TO 99/00, PLEASE AND THANKS
Here is my solution in a shorter macro:
Function NumberToWords(ByVal StartNumber As Currency) As String
Dim Buffer As String
Dim Dollars
Dim Cents
Dim NumberofGroups
Dim NumberSegment
Dim Hundreds
Dim Tens
Dim Ones
GroupNames = Array("", "Thousand ", "Million ", "Billion ", "Trillion ")
OnesNames = Array("", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen ")
TensNames = Array("", "", "Twenty ", "Thirty ", "Fourty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety ")
Dollars = Fix(StartNumber)
Cents = Fix(100 * (StartNumber - Fix(StartNumber)) + 0.5)
NumberofGroups = Fix((Log(Dollars) / Log(10)) / 3)
Dim i
For i = NumberofGroups To 0 Step -1
NumberSegment = Fix(Dollars / 10^ ^ (i * 3))
Hundreds = Fix(NumberSegment / 100)
Tens = Fix((NumberSegment - (Hundreds * 100)) / 10)
Ones = NumberSegment - (Hundreds * 100) - (Tens * 10)
If Hundreds > 0 Then
Buffer = Buffer + OnesNames(Hundreds) + "Hundred "
End If
If Tens > 0 Then
If Tens > 1 Then
Buffer = Buffer + TensNames(Tens) + OnesNames(Ones)
Else
Buffer = Buffer + OnesNames(Tens * 10 + Ones)
End If
Else
Buffer = Buffer + OnesNames(Ones)
End If
If NumberSegment > 0 Then
Buffer = Buffer + GroupNames(i)
End If
Dollars = Dollars - (NumberSegment * 10^ ^ (i * 3))
Next i
Buffer = Buffer + "and "
If Cents < 10 Then
Buffer = Buffer + "0"
End If
Buffer = Buffer + Trim(Str(Cents)) + "/100 *****************************************"
NumberToWords = Buffer
End Function
I need the answer for this
Thanks you very much....
Hi,
Could you tell me the code where I can mention "and" before the last figures e.g. Rs 1,987,290 (Rupees one million nine Hundred eighty seven thousand two hundred and ninety only)
pls use below function
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Rupees, only, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand, "
Place(3) = " Million, "
Place(4) = " Billion, "
Place(5) = " Trillion, "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
only = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Rupees
Case ""
Rupees = "No Rupees"
Case "One"
Rupees = "One Dollar"
Case Else
Rupees = Rupees & " Only"
End Select
SpellNumber = "Rupees " & Rupees
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19…
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99…
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
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
Hi, can i have the code without dollars and cents, E.g.
Four Million Six Hundred Three Thousand Four Hundred Twenty Two
Thank you Bro....
i just want the wording not any currency. what should i do?
How can I download vba code to my phone?
Thank you for this.
However, this was noticed.
For example, i tried to spell 450,750.34
Four Hundred Fifty Thousand Seven Hundred Fifty Dollars and Thirty Four Cents
In my country, we spell like this
Four Hundred and Fifty Thousand, Seven Hundred and Fifty Dollars, Thirty Four Cents
Can you please help me tweak the VBA code to have this new result.
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Rupees, Paisa, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Paisa = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Rupees
Case ""
Rupees = "No Rupees"
Case "One"
Rupees = "One Dollar"
Case Else
Rupees = Rupees & " Rupees"
End Select
Select Case Paisa
Case ""
Paisa = " and No Paisa"
Case "One"
Paisa = " and One Cent"
Case Else
Paisa = " and " & Paisa & " Paisa"
End Select
SpellNumber = Rupees & Paisa
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
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
did u got that code? i need it too
help me naman po pano mag convert numbers to words sa excell for cheque please ..
Thank you Sir for sharing this formula. It's help me a lot! I really appreciate that. Thanks again.
This formula is very good working on any Currency..
I Was looking for him a lot, This formula hit is very good working on any Currency,
i am very happy thank you very much sir, Great job, May Allah bless you.?????????
Assalam -o- Alaikum
My dear brother i want to convert a mathematical digits in english words without any currency like as
564 Five Hundred and Sixty Four
what i do now please help me as soon as possible
i have to prepare Result Cards
Wa Alaikum Assalam,
Dear Raja Zeeshan
Please in macro editor window press Ctrl+F , find Dollar and replace it with empty space . do it again for Dollars and similarly for Cent and cents respectively. I hope it will solve your problem.
I am getting a value like this :Four Hundred Eighty Dollars and Seventy One Cents. Instead of Dollars I want to have it in Kuwaiti Dinars and fills.
Pls help me
Dear, this is to update you that the formula is not working perfectly. See the response that I am getting:->
For Kuwaiti Dinars
for KD 122.050 I got: One Hundred Twenty Two Kuwait Dinar and Five fils
the correct answer has to be: One Hundred Twenty Two Kuwait Dinar and Fifty fils
What to change now
the issue is to replace the separator from "." to "," in the number or in the formula from:
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
to:
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ",")
look at the figure, it says .05 and not .50, the result is correct it seems the figure is point zero five, therefore the result should be five instead of fifty
I keep getting a syntax error
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Dollars = Temp & Place(Count) & Dollars
how can i convert numbers to words for Peso
replace lng mam yung dollars nang pesos (control+h) tapos replace all lng..
dollars to pesos
dollar to peso
How about po yong 66.15 for example.
Sinasabi nya Sixty six pesos and Fourteen Cents lng. Paano po babaguhin para maging fifteen sya.
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Dollars & Cents
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
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
when i copy and paste this, it gives me errors, what am i doing wrong?
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Rupees, Paisa, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Paisa = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Rupees
Case ""
Rupees = "No Rupees"
Case "One"
Rupees = "One Rupees"
Case Else
Rupees = Rupees & " Rupees"
End Select
Select Case Paisa
Case ""
Paisa = " and No Paisa"
Case "One"
Paisa = " and One Paisa"
Case Else
Paisa = " and " & Paisa & " Paisa"
End Select
SpellNumber = Rupees & Paisa
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
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
i use this code but not given result. massage come Privacy warning; This documents contains macros, Activex controls,XML expansion pack information, or web components. These may include personal information that can not be removed by the documents inspector.
than save ur file
please provide sample video
Hello,
I'm trying to convert the numbers into a weight.
ex. 2000 = two thousand pounds
Is there a way to easily convert that?
Regards,
Bryan
How can I convert 123,156,236.64 KG into words? Please help me
Can anyone help with it converting negative numbers?
for example:
-£120.69 reading as Minus One Hundred Pound and Sixty Nine Pence
I am use this formula but there is not convert amount in word format instead of that i show the formula in sheet. pl guide me.
Finally it works on Excell 2010!!! Thank you, Sir!!
I followed your instructions and it works!
123=One hundred and twenty three.
But excel make it
One hundred twenty three.
How am I going to edit the code so that it can accept the "and" even when I type 20550 It should be able to read "Twenty Five Thousand Five Hundred and Fifty
Please Note the "and"
How not spelled if no cents.
Every perfect, but error with unicode is "S" to "?"