Results 1 to 9 of 9

Thread: Number to Words (Rupees)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    3
    Rep Power
    0

    Number to Words (Rupees)

    The VBA coding UDF word is like this as I have read
    Code:
    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
    In India the units are like this
    1 Unit
    10 Ten
    100 1 hundred
    1,000 1 thousand
    10,000 10 thousand
    1,00,000 1 lakh
    10,00,000 10 lakh
    1,00,00,000 1 crore
    10,00,00,000 10 crore
    1,00,00,00,000 1 arab
    10,00,00,00,000 10 arab
    1,00,00,00,00,000 1 kharab
    10,00,00,00,00,000 10 kharab
    1,00.00.00.00.00.000 1 neel
    10,00,00,00,00,00,000 10 neel
    1,00,00,00,00,00,00,000 1 padm
    10,00,00,00,00,00,00,000 10 padm
    1,00,00,00,00,00,00,00,000 1 shankh
    10,00,00,00,00,00,00,00,000 10 shankh
    1,00,00,00,00,00,00,00,00,000 1 samudra
    10,00,00,00,00,00,00,00,00,000 10 samudra
    1,00,00,00,00,00,00,00,00,00,000 1 antya
    10,00,00,00,00,00,00,00,00,00,000 10 antya

    How the codes can be modified. Kindly help me.
    Last edited by Admin; 06-20-2014 at 01:23 PM.

Similar Threads

  1. Yet Another Number-To-Words Function (Sorry, US Style Only)
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 10
    Last Post: 08-06-2020, 02:44 PM
  2. Number into words (Rupees)
    By Admin in forum Download Center
    Replies: 2
    Last Post: 06-14-2014, 12:05 AM
  3. Change Number Written In Words To Numeric Values
    By Safal Shrestha in forum Excel Help
    Replies: 1
    Last Post: 04-03-2013, 03:01 PM
  4. Modifying number to word only (Not Rupees)
    By Excel Fox in forum Excel Help
    Replies: 0
    Last Post: 04-01-2012, 03:46 PM
  5. Number to Words (Rupees)
    By sa.1985 in forum Excel Help
    Replies: 2
    Last Post: 12-16-2011, 08:57 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •