Put into VBA moduke the "words" function below in your and use this
formula:

=UPPER("RUPEES "&words(B31) &" ONLY")

Function words(fig, Optional point = "Point") As String
Dim Digit(14) As Integer
alpha = Array("", "One", "Two", "Three", "Four", "Five", "Six",
"Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen",
"Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen",
"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty",
"Ninety")
figi = Trim(StrReverse(Str(Int(Abs(fig)))))
For i = 1 To Len(figi)
Digit(i) = Mid(figi, i, 1)
Next
For i = 2 To Len(figi) Step 3
If Digit(i) = 1 Then
Digit(i) = Digit(i - 1) + 10: Digit(i - 1) = 0
Else: If Digit(i) > 1 Then Digit(i) = Digit(i) + 18
End If
Next
For i = 1 To Len(figi)
If (i Mod 3) = 0 And Digit(i) > 0 Then words = "hundred " & words
If (i Mod 3) = 1 And Digit(i) + Digit(i + 1) + Digit(i + 2) > 0 Then _
words = Choose(i / 3, "thousand ", "million ", "billion ") & words
words = Trim(alpha(Digit(i)) & " " & words)
Next
If fig <> Int(fig) Then
figc = StrReverse(figi)
If figc = 0 Then figc = ""
figd = Trim(WorksheetFunction.Substitute(Str(Abs(fig)), figc & ".",
""))
words = Trim(words & " " & point)
For i = 1 To Len(figd)
If Val(Mid(figd, i, 1)) > 0 Then
words = words & " " & alpha(Mid(figd, i, 1))
Else: words = words & " Zero"
End If
Next
End If
If fig < 0 Then words = "Negative " & words
End Function

Code source: http://www.accountingweb.co.uk/item/138166

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to