Convert Currency in Number to Words (Indian Rupees)

Cheques, invoices, bills, receipts are needs to have the currency format both in Numerical and words. The below script can be used in Microsoft Excel / Word / Access or any VBA program supported applications to convert the currency in number format to worlds (English). 

  1. span style="color: #808080;">' Edited by Karthikeyan karthikeyan@livetolearn.in
  2. " Thousand "
  3. Place(3) = " lakh "
  4. Place(4) = " Crore "
  5.  
  6.  
  7. ' Convert MyNumber to a string, trimming extra spaces.
  8. ' Find decimal place.
  9. ".")
  10.  
  11. ' If we find decimal place...
  12. ' Convert Paise
  13. "00", 2)
  14. ' Hi! Note the above line Mid function it gives right portion
  15. ' after the decimal point
  16. 'if only . and no numbers such as 789. accures, mid returns nothing
  17. ' to avoid error we added 00
  18. ' Left function gives only left portion of the string with specified places here 2
  19. ' Strip off paise from remainder to convert.
  20. ""' Convert last 3 digits of MyNumber to Indian Rupees.
  21. ""' Remove last 3 converted digits from MyNumber.
  22. ""' convert last two digits to of mynumber
  23. """0"""' Remove last 2 converted digits from MyNumber.
  24. ""' Clean up rupees.
  25. ""
  26. Rupees = """One"
  27. Rupees = "Rupee One""Rupees "' Clean up paise.
  28. ""
  29. Paise = """One"
  30. Paise = "One Paise"" Paise"""" Only"""" Only"" and " & Paise & " Only""One""Two""Three""Four""Five""Six""Seven""Eight""Nine"""' Exit if there is nothing to convert.
  31. ' Append leading zeros to number.
  32. "000" & MyNumber, 3)
  33.  
  34. ' Do we have a hundreds place digit to convert?
  35. "0"" Hundred "' Do we have a tens place digit to convert?
  36. "0"' If not, then convert the ones place digit.
  37. ' Is value between 10 and 19?
  38. "Ten""Eleven""Twelve""Thirteen""Fourteen""Fifteen""Sixteen""Seventeen""Eighteen""Nineteen"' .. otherwise it's between 20 and 99.
  39. "Twenty ""Thirty ""Forty ""Fifty ""Sixty ""Seventy ""Eighty ""Ninety "' Convert ones place digit.

Download this

How to use this code?

 

  • Click on Developer Tab in MS office (Word / Excel / Access). If Developer Tab not appears, click here to know the way to enable this. 
  • Click Visual Basic, then VBA application development window will open
  • Now right click in Project pane, insert -> Module

Inserting VBA module in MS Office

  • Now paste the above code and save it as Macro Enabled document. (For excel save with extension .xlsm)
  • Now you can use the formula '=ConvertCurrencyToEnglish()'

Currency in Number to Worlds - Excel

 

 

MS Access & MS Word Implementations

 

Update 02-03-2017 : Code updated to show 'Rupee/Rupees' as prefix and 'Only' as suffix.

 

Category: