' BELOW FUNCTION COPY AND PASTE
' 1 Start Microsoft Excel.
' 2. Press ALT+F11 to start the Visual Basic Editor.
' 3. On the Insert menu, click Module.
' 4. Type the following code into the module sheet.
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 "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert Paisa and set MyNumber to Rupee amount.
If DecimalPlace > 0 Then
Paisa = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"0", 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 Rupee"
Case Else
Rupees = Rupees & " Rupees only"
End Select
Select Case Paisa
Case ""
Paisa = ""
Case "One"
Paisa = ""
Case Else
Paisa = " and " & Paisa & " Paisa"
End Select
SpellNumber = Rupees '& Paisa
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
'@@@@@@@@@@@
' 1. Select the cell that you want.
' 2. Click Insert Function on the Standard toolbar.
' 3. Under Or select a category, click User Defined.
' 4. In the Select a function list, click SpellNumber,
' and then click OK.
' 5. Enter the number or cell reference that you want,
' and then click OK.
'
' rajput391@yahoo.com
' Cell # 00963336904099
Thanks
please modify the formula for me
example 123456..78
Rupees One Lac Twenty Three Thousand Four Hundred Fifty Six And Seventy Eight Paisa Only
my alternet ID Email id removed for security
pls give formula convert number to word (in excel or word)
exm:1000Rs (one thousand rupees only)
Thank"s & regards
vinod v sharma
Rupees One Lac Twenty Three Thousand Four Hundred Fifty Six And Seventy Eight Paisa Only
formula in xls
pls give formula convert number to word (in excel or word) in simple way please.
exm:1000Rs (one thousand rupees only)
Thank"s & regards
yaseen
Stock market India is volatile and all those who speculate in market are loosing everyday. Please remember stock market is not for speculation purpose. If one feel investing in stock market is gamble then its better to think again.
One should always note that if they want to invest money they should do proper research be it fundamental research or technical research. Just think how come you can invest
your money without any convincing reason for the same?
Indian stock market is one of the most happening and emerging market. Major Indian stock exchanges are BSE and NSE and both are of world class standards.
So grab good stocks and invest that’s the bottom line.
We hope to see you in major profits.
Regards
<a href="http://www.sharetipsinfo.com" title="SHARETIPSINFO TEAM">SHARETIPSINFO TEAM</a>
U tell me which process in this formula in my Exel sheet every time.
I call u any time, please confirm that.
Ronny.
Many thanks for your help. Your code is working OK.
Regards,
Moe
Email id removed for security
its really works
thanks
where is these option in excel for the above mentioned kindly reply
1. open the excel file
2. Press ALT and F11 keys at the same time
3 Click on "Insert" and insert a "module"
4.In the solution ( http://en.kioskea.net/forum/affich-94180-how-to-convert-a-numeric-value-into-eng-word#6 ) the code starts at "Function words(fig, Optional point = "Point") As String " and ends at "End Function". Copy the complete code and paste on the newly inserted module
5 Press ALT and Q keys at same time to save code
6 Return on Excel sheet
7. use the formula like
=words(A1) --> using value from cell A1tc.
=words(123456)--> using numbers diferctly