hello, everyone
i want to change my amount to words, in Crore Lac Thousands and Rupees.
170800 = one lac seventy thousand and eight hundred only
thanx
hello, everyone
i want to change my amount to words, in Crore Lac Thousands and Rupees.
170800 = one lac seventy thousand and eight hundred only
thanx
Use Code-Tags for showing your code :
Please mark your question Solved if there has been offered a solution that works fine for you
If You like solutions provided by anyone, feel free to add reputation using STAR *
Google Excel Spell Number
http://www.yogeshguptaonline.com/200...bers-into.html
And more ...
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
in this formula, i don't want hundred and rupee, thanx
![]()
Function SpellNumber(amt As Variant) As Variant Dim FIGURE As Variant Dim LENFIG As Integer Dim i As Integer Dim WORDs(19) As String Dim tens(9) As String WORDs(1) = "One" WORDs(2) = "Two" WORDs(3) = "Three" WORDs(4) = "Four" WORDs(5) = "Five" WORDs(6) = "Six" WORDs(7) = "Seven" WORDs(8) = "Eight" WORDs(9) = "Nine" WORDs(10) = "Ten" WORDs(11) = "Eleven" WORDs(12) = "Twelve" WORDs(13) = "Thirteen" WORDs(14) = "Fourteen" WORDs(15) = "Fifteen" WORDs(16) = "Sixteen" WORDs(17) = "Seventeen" WORDs(18) = "Eighteen" WORDs(19) = "Nineteen" tens(2) = "Twenty" tens(3) = "Thirty" tens(4) = "Fourty" tens(5) = "Fifty" tens(6) = "Sixty" tens(7) = "Seventy" tens(8) = "Eighty" tens(9) = "Ninety" FIGURE = amt FIGURE = Format(FIGURE, "FIXED") FIGLEN = Len(FIGURE) If FIGLEN < 12 Then FIGURE = Space(12 - FIGLEN) & FIGURE End If 'If Val(Left(FIGURE, 9)) > 1 Then 'SpellNumber = "Rs " 'ElseIf Val(Left(FIGURE, 9)) = 1 Then 'SpellNumber = "Rs " 'End If For i = 1 To 3 If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1))) SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1))) End If If i = 1 And Val(Left(FIGURE, 2)) > 0 Then SpellNumber = SpellNumber & " Crore " ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then SpellNumber = SpellNumber & " Lakh " ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then SpellNumber = SpellNumber & " Thousand " End If FIGURE = Mid(FIGURE, 3) Next i If Val(Left(FIGURE, 1)) > 0 Then SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 1))) + " Hundred " End If FIGURE = Mid(FIGURE, 2) If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1))) SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1))) End If FIGURE = Mid(FIGURE, 4) If Val(FIGURE) > 0 Then SpellNumber = SpellNumber & " Paise " If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1))) SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1))) End If End If FIGURE = amt FIGURE = Format(FIGURE, "FIXED") If Val(FIGURE) > 0 Then SpellNumber = SpellNumber & " Only " End If End Function Sub Add_Trunk_formula_for_remove_decimals() Range("I1").Select ActiveCell.FormulaR1C1 = "=TRUNC(RC[-1])" Range("I1").Select Selection.AutoFill Destination:=Range("I1:I90"), Type:=xlFillDefault Range("I1:I90").Select Columns("I:I").Select Selection.EntireColumn.Hidden = True End Sub Sub Make_Words_From_Numbers() Range("J3").Select ActiveCell.FormulaR1C1 = "=SpellNumber(RC[-1])" Range("J3").Select Selection.AutoFill Destination:=Range("J3:J90"), Type:=xlFillDefault Range("J1").Select ActiveCell.FormulaR1C1 = "=SpellNumber(RC[-1])" End Sub Sub Border_For_Words() Range("J3:J90").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With End Sub
Thanx alot for replying....
Answered here: http://www.excelforum.com/excel-gene...s-formula.html
If you're going to start new threads for the same question, please mark the older ones as solved and provide links to the new thread.
Ok
tms
thanx alot
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks