Convert number to String by using Array : Array « Data Type « VBA / Excel / Access / Word

Home
VBA / Excel / Access / Word
1.Access
2.Application
3.Data Type
4.Data Type Functions
5.Date Functions
6.Excel
7.File Path
8.Forms
9.Language Basics
10.Math Functions
11.Outlook
12.PowerPoint
13.String Functions
14.Windows API
15.Word
16.XML
VBA / Excel / Access / Word » Data Type » Array 
Convert number to String by using Array
 


Function NumberToString(lngNumber As LongAs String

    Dim strNumber  As String    
    Dim intLoop    As Integer   
    Dim strRV      As String    
    Dim strTemp    As String    
    Dim astrNumbers As Variant  
    Dim iNumber     As Integer  

    astrNumbers = Array("Zero""One""Two""Three""Four", _
                      "Five""Six""Seven""Eight""Nine")

    strNumber = lngNumber

    For intLoop = To Len(strNumber)
        iNumber = Int(Mid$(strNumber, intLoop, 1))
        strRV = strRV & astrNumbers(iNumber" "
    Next
    NumberToString = strRV

End Function

 
Related examples in the same category
1.Get the element in an array by index
2.Declaring a static array is similar to declaring a variable
3.Override the Option Base setting by specifically setting the lower bound in the array declaration
4.Declaring and Working with Fixed Arrays
5.Declaring array and setting bounds
6.Arrays are typically initialized inside a loop
7.Use the For Each...Next to assign value to an array
8.Use count function to count array
9.Use count function to sum array
10.Using a One-Dimensional Array
11.Define and use multidimensional array
12.Create an Array, assign value and use Loop to show its value
13.Use LBound and UBound in for statement
14.Using a Two-Dimensional Array and Reference its elements
15.Understanding Errors in Arrays
16.Function Parameter type: Array
17.Assign range to an array
18.Declaring a static array is similar to declaring a variable, with one small exception
19.To assume that 1 is the lower index for your arrays
20.Multidimensional arrays
21.Sorts the List array in ascending order
22.Sorting an Array
23.Searching through an Array
24.Fill array by using a nested For- Next loop.
25.Referencing Elements in a Multi-dimensional Array
26.Specifying the Index Range of an Array
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.