Just found this code somwhere  see in attached text file copy paste and run
it.

' Make a form with two textboxs with the standard names
' textbox1 and textbox2.
' Textbox1 is the input numbers box.
' Textbox2 displays the words spelled out





On Fri, Mar 25, 2011 at 11:21 PM, hanumant shinde <hanumant_5...@yahoo.co.in
> wrote:

>  Hi Friends,
>
> how can we convert the numeric value to its text e.g. if i type 1 its text
> value should be One if i type 132 its text value should be One hundred
> thirty two.and so on.
>
>
>
> --
>
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links :
> http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><><><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
>



-- 
Regards
Payal Nandwana
# 9810871584






Indolence is a delightful but distressing state; we must be doing something
to be happy

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel


Public Class Form1

    Public Arr1() As String = New String(20) {"", "One", "Two", "Three", 
"Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", 
"Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", 
"Nineteen", "Twenty"}

    Public Arr10() As String = New String(9) {"", "Ten", "Twenty", "Thirty", 
"Fourty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}

    Public words As String



    Private Sub donum(ByVal num As Long)

        If num <= 20 Then

            words = Arr1(num)

            Return

        End If

        Dim Spel As Long

        Dim rema As Long

        Spel = Int(num / 1000000000)

        rema = (num Mod 1000000000)

        If Spel > 0 Then

            Dim bil_hold As Long = rema

            donum(Spel)

            words = words & " Billion "

            num = bil_hold

        End If

        Spel = Int(num / 1000000)

        rema = (num Mod 1000000)

        If Spel > 0 Then

            Dim mil_hold As Long = rema

            donum(Spel)

            words = words & " Million "

            num = mil_hold

        End If

        Spel = Int(num / 1000)

        rema = (num Mod 1000)

        If Spel > 0 Then

            Dim thos_hold As Long = rema

            donum(Spel)

            words = words & " Thousand "

            num = thos_hold

        End If

        Spel = Int(num / 100)

        If Spel > 0 Then

            words = words & " " & Arr1(Spel) & " " & "Hundred "

            num = num - (Spel * 100)

        End If

        Spel = num

        If Spel > 19 Then

            words = words & Arr10(Int(Spel / 10)) & " " & Arr1(Spel - (Int(Spel 
/ 10) * 10)) ' & " " & "Thousand"

        ElseIf Spel < 19 And Spel > 0 Then

            words = words & " and " & Arr1(Spel)

        End If

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles TextBox1.TextChanged

        Try

            Dim Numtry As Long = Val(TextBox1.Text)

        Catch ex As Exception

            MsgBox("Number too large")

            Return

        End Try

        Dim Num As Long = Val(TextBox1.Text)

        words = ""

        donum(Num)

        words.Replace(" ", " ")

        TextBox2.Text = words

    End Sub

End Class

Reply via email to