Ever since I discovered CHOOSE function, it has made my functions very small in cases like this one.
VB Code:
  1. Private Sub Command1_Click()
  2.     '*** Usage ***
  3.     MsgBox AmountToWords(InputBox("Enter Amount:"))
  4. End Sub
  5.  
  6. Private Function AmountToWords(ByVal num As Double)
  7.     Dim s As String, sa() As String
  8.    
  9.     'Rupees part
  10.     s = Int(num)
  11.     s = Format(s, "-##-##-##-##-##-#-##")
  12.     Do While InStr(s, "--") > 0
  13.         s = Replace(s, "--", "-")   'remove extra seperators
  14.     Loop
  15.     If s = "-" Then
  16.         AmountToWords = "Rupees Zero"
  17.     Else
  18.         sa = Split(s, "-")
  19.         For i = UBound(sa) To 1 Step -1
  20.             AmountToWords = GetNum(sa(i)) & GetPlace(sa(i), UBound(sa) - i + 1) & AmountToWords
  21.         Next
  22.         AmountToWords = "Rupees " & AmountToWords
  23.     End If
  24.    
  25.     'Paise Part
  26.     If Int(num) <> num Then
  27.         s = Format(num, "0.00")
  28.         s = Mid(s, InStr(s, ".") + 1, 2)
  29.         AmountToWords = AmountToWords & " and " & GetNum(s) & " paise"
  30.     End If
  31.     AmountToWords = AmountToWords & " only"
  32. End Function
  33.  
  34. Private Function GetNum(ByVal num As Long) As String
  35.     Select Case num
  36.     Case 0
  37. '        GetNum = "zero"
  38.     Case Is < 11
  39.         GetNum = Choose(num, "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten")
  40.     Case Is < 20
  41.         GetNum = Choose(num - 10, "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen")
  42.     Case Is < 100
  43.         GetNum = Choose(num \ 10, "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety")
  44.         GetNum = GetNum & " " & GetNum(num Mod 10)
  45.     End Select
  46. End Function
  47.  
  48. Private Function GetPlace(ByVal num As Long, ByVal nPlace As Long) As String
  49.     If num > 0 Then GetPlace = Choose(nPlace, "", " hundred ", " thousand ", " lakh ", " crore ", " million ", " billion ", " trillion ")
  50. End Function