Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I display a number in writing (letters)

Hi, Could you please tell me how can I display a number in writing its value
(letters)
for example if I have a cell contains the result 43529.
How can i display this result in writing like:
Forty Three Thousand Five Hundred Twenty Nine Only

Please help
Best regards

Dr. Dhia Al-Ani
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default How do I display a number in writing (letters)

That requires vba... Here is a function that will get you close...

Public Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, 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 cents and set MyNumber to dollar amount.
If DecimalPlace 0 Then
Cents = 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 Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Application.Trim(Dollars & Cents)
End Function

Place that code in a standard code module (the same place as the code from a
recorded mcaro ends up). Now in any cell in the worksheet you can use this
like this...

=SpellNumber(A1)
where A1 has the numer you want spelled out...
--
HTH...

Jim Thomlinson


"Dr. Dhia A. Mousa Al-Ani" wrote:

Hi, Could you please tell me how can I display a number in writing its value
(letters)
for example if I have a cell contains the result 43529.
How can i display this result in writing like:
Forty Three Thousand Five Hundred Twenty Nine Only

Please help
Best regards

Dr. Dhia Al-Ani

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display all combination of letters Mally Excel Discussion (Misc queries) 7 January 4th 09 05:42 AM
column display, letters or numbers bill Excel Discussion (Misc queries) 1 June 9th 08 06:37 PM
how will the sum will display in letters also how will the sum will display in letters Excel Discussion (Misc queries) 1 April 18th 07 02:00 PM
Display Improvement for Writing Formulas Brian Preston Excel Worksheet Functions 1 July 5th 06 01:56 PM
writing the columns a number is listed in David Excel Worksheet Functions 2 March 11th 05 11:18 PM


All times are GMT +1. The time now is 04:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"