Microsoft Certifications Practice Tests:
Exam 70-506
Exam 77-881
Exam 70-583
Exam 70-642
Exam 77-882
Exam 70-680
Forum
Articles
Microsoft Exams
Windows 8 Articles
Windows 8 News
Product Reviews
New Member FAQ
|
Microsoft Office 365
|
Bookmarks
|
HTML 5 Tutorials
|
Lobby
|
Members
|
Polls
|
Revenue Sharing
|
New Posts
|
Resources
»
Microsoft Software
»
Microsoft Office
Excel tips-: How to convert numeric amount to on words in Microsoft Excel
Posted Date:
09-Jul-2010
Category:
Microsoft Office
Author:
Brajamohan panda
Member Level:
Gold
Rating:
Points
: 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!
Tweet
Share
Related Resources:
What are the benefits of using the Microsoft office 2010 ?
Microsoft Products Code Name
Microsoft Network Monitor 3.4
Excel tips-How to print headings/Titles in every page
Take a look on all the versons of windows
What special has been added to the Microsoft Office 2010 ?
How to install a blue tooth enabled device in your windows 7 computer
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:
Notify me by email when others post comments to this article.
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
New Features of Microsoft Office 2010
How to open Docx files in Word 2003 or Word XP?
Excel tips-How to print headings/Titles in every page
How to save PDF from Microsoft office
Data formatting tutorial for MS-Excel 2010
Changing the settings of an email account in Outlook 2010
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
Sign In
Register
AdSense Revenue
Online Members
SkyDrive Sucks
abhimanyu singh
More...
Active Members
Today
chirag sachdev...
(40)
Nitheesh Irina...
(7)
Priyabrata Das
(2)
Last 7 Days
Tony John
(202)
preeti saxena
(160)
chirag sachdev...
(150)
more...
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.