How To Convert Numbers To Words In Indian Rupees In Excel
Convert Numbers To Words In Indian Rupees With VBA Code
Convert Numbers To Words In Indian Rupees In Excel, How to convert numbers to words in Indian rupees in Excel?, Convert numbers into words - Excel, SpellNumber Indian Rupees Function In Excel,
Convert Currency in Number to Words (Indian Rupees), Convert number to words in Indian Rupees in Excel, Convert number to words in Indian rupees Online, Convert number to words in Excel, Spell number in Excel, Spell number in Excel download, How to convert numeric into words in Excel 2007,How to write Rupees in words
The following VBA code can help you to convert the numbers to words in Indian rupees.
Things to note
1. Press Your keyboard ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Click on top bar menu Insert > Module, and paste the following code in the Module Window.
3. Save excel file in Save as type- Excel Micro-Enabled Workbook
After pasting the code, save and close the code window, return to the worksheet and enter the following formula: = Inword (A1) in a blank cell, see screenshot
VBA code: Convert numbers to words in Indian rupees format:-
[Public Function inword(SNum As String)'Updateby ExtendofficeDim xDPInt As IntegerDim xArrPlace As VariantDim xRStr_Paisas As StringDim xNumStr As StringDim xF As IntegerDim xTemp As StringDim xStrTemp As StringDim xRStr As StringDim xLp As IntegerxArrPlace = Array("", "", " Thousand ", " Lacs ", " Crores ", " Trillion ", "", "", "", "")On Error Resume NextIf SNum = "" Theninword = ""Exit FunctionEnd IfxNumStr = Trim(str(SNum))If xNumStr = "" Theninword = ""Exit FunctionEnd IfxRStr = ""xLp = 0If (xNumStr > 999999999.99) Theninword = "Digit excced Maximum limit"Exit FunctionEnd IfxDPInt = InStr(xNumStr, ".")If xDPInt > 0 ThenIf (Len(xNumStr) - xDPInt) = 1 ThenxRStr_Paisas = inword_GetT(Left(Mid(xNumStr, xDPInt + 1) & "0", 2))ElseIf (Len(xNumStr) - xDPInt) > 1 ThenxRStr_Paisas = inword_GetT(Left(Mid(xNumStr, xDPInt + 1), 2))End IfxNumStr = Trim(Left(xNumStr, xDPInt - 1))End IfxF = 1Do While xNumStr <> ""If (xF >= 2) ThenxTemp = Right(xNumStr, 2)ElseIf (Len(xNumStr) = 2) ThenxTemp = Right(xNumStr, 2)ElseIf (Len(xNumStr) = 1) ThenxTemp = Right(xNumStr, 1)ElsexTemp = Right(xNumStr, 3)End IfEnd IfxStrTemp = ""If Val(xTemp) > 99 ThenxStrTemp = inword_GetH(Right(xTemp, 3), xLp)If Right(Trim(xStrTemp), 3) <> "Lac" ThenxLp = xLp + 1End IfElseIf Val(xTemp) <= 99 And Val(xTemp) > 9 ThenxStrTemp = inword_GetT(Right(xTemp, 2))ElseIf Val(xTemp) < 10 ThenxStrTemp = inword_GetD(Right(xTemp, 2))End IfIf xStrTemp <> "" ThenxRStr = xStrTemp & xArrPlace(xF) & xRStrEnd IfIf xF = 2 ThenIf Len(xNumStr) = 1 ThenxNumStr = ""ElsexNumStr = Left(xNumStr, Len(xNumStr) - 2)End IfElseIf xF = 3 ThenIf Len(xNumStr) >= 3 ThenxNumStr = Left(xNumStr, Len(xNumStr) - 2)ElsexNumStr = ""End IfElseIf xF = 4 ThenxNumStr = ""ElseIf Len(xNumStr) <= 2 ThenxNumStr = ""ElsexNumStr = Left(xNumStr, Len(xNumStr) - 3)End IfEnd IfxF = xF + 1LoopIf xRStr = "" ThenxRStr = "No Rupees"ElsexRStr = " Rupees " & xRStrEnd IfIf xRStr_Paisas <> "" ThenxRStr_Paisas = " and " & xRStr_Paisas & " Paisas"End Ifinword = xRStr & xRStr_Paisas & " Only"End FunctionFunction inword_GetH(xStrH As String, xLp As Integer)Dim xRStr As StringIf Val(xStrH) < 1 Theninword_GetH = ""Exit FunctionElsexStrH = Right("000" & xStrH, 3)If Mid(xStrH, 1, 1) <> "0" ThenIf (xLp > 0) ThenxRStr = inword_GetD(Mid(xStrH, 1, 1)) & " Lac "ElsexRStr = inword_GetD(Mid(xStrH, 1, 1)) & " Hundred "End IfEnd IfIf Mid(xStrH, 2, 1) <> "0" ThenxRStr = xRStr & inword_GetT(Mid(xStrH, 2))ElsexRStr = xRStr & inword_GetD(Mid(xStrH, 3))End IfEnd Ifinword_GetH = xRStrEnd FunctionFunction inword_GetT(xTStr As String)Dim xTArr1 As VariantDim xTArr2 As VariantDim xRStr As StringxTArr1 = Array("Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")xTArr2 = Array("", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety")Result = ""If Val(Left(xTStr, 1)) = 1 ThenxRStr = xTArr1(Val(Mid(xTStr, 2, 1)))ElseIf Val(Left(xTStr, 1)) > 0 ThenxRStr = xTArr2(Val(Left(xTStr, 1)) - 1)End IfxRStr = xRStr & inword_GetD(Right(xTStr, 1))End Ifinword_GetT = xRStrEnd FunctionFunction inword_GetD(xDStr As String)Dim xArr_1() As VariantxArr_1 = Array(" One", " Two", " Three", " Four", " Five", " Six", " Seven", " Eight", " Nine", "")If Val(xDStr) > 0 Theninword_GetD = xArr_1(Val(xDStr) - 1)Elseinword_GetD = ""End IfEnd Function]
Convert Numbers To Words In Indian Rupees In Excel,
How to convert numbers to words in Indian rupees in Excel?
Convert numbers into words - Excel
SpellNumber Indian Rupees Function In Excel
Convert Currency in Number to Words (Indian Rupees)
Convert number to words in Indian Rupees in Excel
Convert number to words in Indian rupees Online
Convert number to words in Excel
Spell number in Excel
Spell number in Excel download
How to convert numeric into words in Excel 2007
How to write Rupees in words