Tuesday, 10 June 2014

How to Convert Number into Word in Excel in Indian Rupees

Convert number into word in excel in Indian Rupees,, this code will work in all version of Microsoft Excel like (2003, 2007, 2010, 2013). Just fallow these easy steps.
1)         Copy this code
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 = "Rupees "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
SpellNumber = "Rupee "
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

2)         Open excel sheet and press “Alt+F11”
3)         A new windows will appear click on “Inert” and then “Module”
4)        Paste the code in box
5)         Click on “File” and then “Close and return to Microsoft Excel”

6)        Keep the course in box where you want to convert number to word and type “=spellnumber(row & column)” (Eg. E7) and press “Enter”

See Video tutorial..... Please like, share and subscribe 

29 comments:

KD SINGH said...

Very useful. Thanks for sharing the code.

KD SINGH said...

Please let me know whether this will work in all excel file or a particular file?

Jayant Volvoikar said...

Very useful. Thanks

Ashish Soni said...

It works on the particular excel file where we put the codes. Can you please tell me how to add this codes in all excel files!!

pallabjyoti kalita said...

Very useful. Thanks

Darshana Mrug said...

very useful thanks a million

Maher Sakka said...

Thank you ! Need this feature on your android phone ?
You have problems writing your amounts in letters on checks? transfer form? rebate check form?
SpellMyAmount facilitate you all this; you enter the amount in numbers and it writes it for you in letters.
SpellMyAmount is an Android application available on Google Play!
Download it now: https://goo.gl/55u2YQ

Manoj Kajale said...

Thank You! Very Much.....!

vijay kumar karma said...

Very Useful. Thanks for sharing

Krunal Gilitwala said...

very very useful thanks for sharing this programme

Khairul Hasan said...

thank you very much.............very helpful guideline

Samarth Gupta said...

How to save excel file with this code, so if i open excel next day it will work

murali Perike said...

very nice brooooo

Unknown said...

Lots of Thanks Bro

Unknown said...

tq very much its very use full

Yam Sophanna said...

How can we use for us dollars?

Yam Sophanna said...

How can we use for us dollars?

ukjobs said...

Very useful. Thanks for sharing just like this code. Please share if we want to use it like this 1) Thousands, 2) hundred thousands, 3) millions, 4) trillions etc.

Anonymous said...

this formula works for same sheet means in which we had put formula
but in another file, it does not work.
pl. guide.

I am That said...

Thank you very much. This worked great ! God Bless you.

Anonymous said...

Thank You Very Much

Unknown said...

Thanks for sharing

Sufi Alam said...

hat off man

Goli krishna chaitanya said...

thanking you a lot sir it useful us very much. great job sir

Subhash Garg said...

not working

Md Aminul Islam Nirob said...

it is very helpful for me. thanks a lot sir...why NinetyFive like this


Jagesh Ladani said...

VERY NICE AND HILLY USEFUL TO ME
BUT WHY IT CHANGE EVERY TIME WHEN OPEN
CAN DO PERMEATE SAVE
REGARDING MECRO

suri said...

Thanks for the Program, its very useful!!
Great job dude!!

Anonymous said...

I'm facing different problems while opening the file 2nd time,

Error 1: Compile error: Syntax error (I can't understand about this type of error)

Error 2: #NAME? (On cell where I put formula previous)

Please help me to solve this problem.

Popular Posts