LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default Is there a formular or format to change 1 to one

Hi Kevin

To convert whole numbers, or integer values, try this minor adaptation of
the main SpellNumber function:

'============
Function SpellNumber(ByVal MyNumber)
Dim sStr As String
Dim Temp As Variant
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, ".")
' Remove decimals
If DecimalPlace 0 Then
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If

Count = 1
Do While MyNumber < ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp < "" Then sStr = Temp & Place(Count) & sStr
If Len(MyNumber) 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop

SpellNumber = sStr

End Function
'<<============



---
Regards,
Norman


"Kevin" wrote in message
...
Thanks for the tip. Is there one that does the numbers without the dollars
and cents.
Kevin

"Norman Jones" wrote:

Hi Kevin,

See:

http://www.xldynamic.com/source/xld.xlFAQ0004.html


---
Regards,
Norman



"Kevin" wrote in message
...
Is there a formular or format to change a number "1" into the word
"one".








 
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
Is it possible to change the default number format in Excel? Andrew Excel Discussion (Misc queries) 5 April 24th 23 09:01 PM
Change general format to US date format woodlot4 Excel Discussion (Misc queries) 3 October 11th 05 12:29 AM
How to change default cell format to "Text" rbecerra Excel Discussion (Misc queries) 2 September 10th 05 04:29 AM
How to change the excel format from language to language? zee Excel Discussion (Misc queries) 2 January 30th 05 06:51 PM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM


All times are GMT +1. The time now is 10:57 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"