Microsoft Certifications Practice Tests:   Exam 70-506   Exam 77-881   Exam 70-583   Exam 70-642   Exam 77-882   Exam 70-680   
windows 8
 


ForumArticlesMicrosoft ExamsWindows 8 ArticlesWindows 8 NewsProduct Reviews



Resources » Microsoft Software » Microsoft Office


Excel tips-: How to convert numeric amount to on words in Microsoft Excel


Posted Date:     Category: Microsoft Office    
Author: Member Level: Gold    
Rating: 2 out of 52 out of 5Points: 10 (Rs 6)


Microsoft excel is a one of the powerful tool to office work.Many time we need word value of our numeric rupees.So in this article we will learn how to convert numeric value to word value


1. First open Microsoft Excel
2. Open visual basic editor (Shortcut Key Alt+F11)
3. On visual basic editor go to insert tab and click module button.
4. Then copy and paste the below code on module sheet.


'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Rupees, paisa, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert paisa and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
paisa = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Rupees
Case ""
Rupees = "No Rupees"
Case "One"
Rupees = "One Dollar"
Case Else
Rupees = Rupees & " Rupees"
End Select
Select Case paisa
Case ""
paisa = " and No paisa"
Case "One"
paisa = " and One Cent"
Case Else
paisa = " and " & paisa & " paisa"
End Select
SpellNumber = Rupees & paisa
End Function
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) <> "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function



5. Then close visual basic editor.
6. Now your project is ready for use.
7. Type where you required word value
=SpellNumber(5020)
8-If you want value on dollar or cent then change code rupees to dollar or cent to paisa
9-Now go to save Manu click save excel micro enabled document workbook.
10-Now your project is completely ready for use


Did you like this resource? Share it with your friends and show your love!




Related Resources:


Read related articles: Microsoft Excel tips    Microsoft products    


Responses to "Excel tips-: How to convert numeric amount to on words in Microsoft Excel"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)
    Website: We will link to your website, if the comment is worth keeping!



    Type the numbers and letters shown on the left.


    Next Resource: New Features of Microsoft Office 2010
    Previous Resource: What special has been added to the Microsoft Office 2010 ?
    Return to Resources
    Post New Resource
    Category: Microsoft Office


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Excel formula  .  Excel exchange  .  Excel tags  .  Excel tips  .  

    Subscribe to Windows resources by Email


    Awards & Gifts



    Silverlight 4 free practice test is now live!

    My Profile

    Online MembersSkyDrive Sucks
    abhimanyu singh
    More...

    Active Members
    TodayLast 7 Daysmore...


    Quick Links:Windows 8 beta
    Windows 8 Installation
    Windows 8 Features
    Google Plus
    Microsoft Office 365
    Microsoft Lync 2010
    Silverlight 5
    HTML 5
    Cloud Computing
    Rupee Symbol
    Internet Explorer 9
    Windows Azure

    RSS Feeds Resource Feeds
    Forum Feeds
    Job Feeds



    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.