In other words, you are looking for a test to see if your 10 character
number string is made up of digits only, right? Here is a function that
will do that...
Function IsDigitsOnly(Value As String) As Boolean
IsDigitsOnly = Len(Value) > 0 And _
Not Value Like "*[!0-9]*"
End Function
If you want to incorporate this function's code directly within your own
code (without needing to call a separate function), then your test would
be structured something like this...
If Len(TenCharString) > 0 And Not TenCharString Like "*[!0-9]*" Then
' TenCharString is made up of digits only
Else
' At least one character in TenCharString is not a digit
End If
--
Rick (MVP - Excel)
Fan924 said:
I have a 10 character number string. I need a test to confirm that
there are no non-numeric characters in this string. Thanks
Excel97