Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default to make the digit 10 into the text ten

can i type in a numer (ie 10) in A1 and have A2 fill in automatically the
written "ten"? etc
--
Tbarbee708
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default to make the digit 10 into the text ten

http://support.microsoft.com/default...EN-US;Q213360&
--
Gary''s Student - gsnu200826


"Tbarbee708" wrote:

can i type in a numer (ie 10) in A1 and have A2 fill in automatically the
written "ten"? etc
--
Tbarbee708

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default to make the digit 10 into the text ten

GREAT!!!! thank you Gary solved my problemo, thank you
--
Tbarbee708


"Gary''s Student" wrote:

http://support.microsoft.com/default...EN-US;Q213360&
--
Gary''s Student - gsnu200826


"Tbarbee708" wrote:

can i type in a numer (ie 10) in A1 and have A2 fill in automatically the
written "ten"? etc
--
Tbarbee708

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default to make the digit 10 into the text ten

Gary, 1 last thing, it is putting in the words"dollars and cents" behind the
ten how can I get it to not include any other words except the digit ?
thank you
--
Tbarbee708


"Gary''s Student" wrote:

http://support.microsoft.com/default...EN-US;Q213360&
--
Gary''s Student - gsnu200826


"Tbarbee708" wrote:

can i type in a numer (ie 10) in A1 and have A2 fill in automatically the
written "ten"? etc
--
Tbarbee708

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default to make the digit 10 into the text ten

You can do this without changing the programming.

With 10 in A1 and ten in B1 enter in C1:
=B1 & " dollars and cents"
--
Gary''s Student - gsnu200826


"Tbarbee708" wrote:

Gary, 1 last thing, it is putting in the words"dollars and cents" behind the
ten how can I get it to not include any other words except the digit ?
thank you
--
Tbarbee708


"Gary''s Student" wrote:

http://support.microsoft.com/default...EN-US;Q213360&
--
Gary''s Student - gsnu200826


"Tbarbee708" wrote:

can i type in a numer (ie 10) in A1 and have A2 fill in automatically the
written "ten"? etc
--
Tbarbee708



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default to make the digit 10 into the text ten

You will have to change the code if you don't want the "dollars and cents"
returned.

Try this revision..........but it doesn't do decimals, only whole numbers.


Function SpellNumber(ByVal n As Double, _
Optional ByVal useword As Boolean = True, _
Optional ByVal cents As String = "", _
Optional ByVal join As String = " And", _
Optional ByVal fraction As Boolean = False) As String


Dim myLength As Long
Dim i As Long
Dim myNum As Long
Dim Remainder As Long

SpellNumber = ""
Remainder = Round(100 * (n - Int(n)), 0)

myLength = Int(Application.Log10(n) / 3)

For i = myLength To 0 Step -1
myNum = Int(n / 10 ^ (i * 3))
n = n - myNum * 10 ^ (i * 3)
If myNum 0 Then
SpellNumber = SpellNumber & MakeWord(Int(myNum)) & _
Choose(i + 1, "", " thousand ", " million ", " billion ", " trillion ")
End If
Next i
SpellNumber = SpellNumber & IIf(useword, " " & ccy, "")
SpellNumber = Application.Proper(Trim(SpellNumber))

End Function

Function MakeWord(ByVal inValue As Long) As String
Dim unitWord, tenWord
Dim n As Long
Dim unit As Long, ten As Long, hund As Long

unitWord = Array("", "one", "two", "three", "four", _
"five", "six", "seven", "eight", _
"nine", "ten", "eleven", "twelve", _
"thirteen", "fourteen", "fifteen", _
"sixteen", "seventeen", "eighteen", "nineteen")
tenWord = Array("", "ten", "twenty", "thirty", "forty", _
"fifty", "sixty", "seventy", "eighty", "ninety")
MakeWord = ""
n = inValue
If n = 0 Then MakeWord = "zero"
hund = n \ 100
If hund 0 Then MakeWord = MakeWord & MakeWord(Int(hund)) _
& " hundred and "
n = n - hund * 100
If n < 20 Then
ten = n
MakeWord = MakeWord & unitWord(ten) & " "
Else
ten = n \ 10
MakeWord = MakeWord & tenWord(ten) & " "
unit = n - ten * 10
MakeWord = Trim(MakeWord & unitWord(unit))
End If
MakeWord = Application.Proper(Trim(MakeWord))

End Function


Gord Dibben MS Excel MVP

On Wed, 14 Jan 2009 13:27:00 -0800, Tbarbee708
wrote:

Gary, 1 last thing, it is putting in the words"dollars and cents" behind the
ten how can I get it to not include any other words except the digit ?
thank you


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
Convert dates to 8 digit text HelenONeill Excel Discussion (Misc queries) 4 August 15th 07 01:28 PM
Digit to Text Subhashis Bhowmick[_2_] Excel Worksheet Functions 3 June 19th 07 03:33 PM
Make last digit always display the same value. Dave Plyer Excel Discussion (Misc queries) 5 April 14th 07 12:59 PM
4, 5, and 6 digit numbers should be text Jim May Excel Discussion (Misc queries) 4 June 25th 06 04:53 PM
combine the text or digit in different cells hande Excel Discussion (Misc queries) 1 January 6th 05 02:44 PM


All times are GMT +1. The time now is 09:56 PM.

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

About Us

"It's about Microsoft Excel"