Use this function given below:
Public Function NumbersOnly(ByVal strText As String) As Boolean
Dim intCounter As Integer
For intCounter = 1 To Len(strText)
If Not IsNumeric(Mid(strText, intCounter, 1)) Then
NumbersOnly = False
Exit Function
End If
Next intCounter
NumbersOnly = True
End Function
Public Function NumbersOnly(ByVal strText As String) As Boolean
Dim intCounter As Integer
For intCounter = 1 To Len(strText)
If Not IsNumeric(Mid(strText, intCounter, 1)) Then
NumbersOnly = False
Exit Function
End If
Next intCounter
NumbersOnly = True
End Function
No comments:
Post a Comment