|
|
See also: GetDigitsOnly and IsAlphaOnly CODE ' Code courtesy of UtterAccess Wiki
' http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary ' Original submission by Walter Niesz ' July 25, 2010 ' ' You are free to use it in any application, ' provided the copyright notice is left unchanged. ' DESCRIPTION ' This function tests a given string to see ' whether it is composed of all numeric digits. Const AllNumbers = "0123456789" Public Function IsNumbersOnly(StringToTest As String) As Boolean Dim i As Long IsNumbersOnly = True For i = 1 To Len(StringToTest) If InStr(AllNumbers, Mid(StringToTest, i, 1)) = 0 Then IsNumbersOnly = False Exit Function End If Next i End Function
|
| This page was last modified 09:38, 6 April 2011. This page has been accessed 1,649 times. Disclaimers |