how do i find out if the first letter of a string is a number?
Printable View
how do i find out if the first letter of a string is a number?
don't worry i've figured it out
Code:Private Sub Form_Load()
MsgBox CheckNumber("01243")
End Sub
Function CheckNumber(strString As String) As Boolean
Dim myAsc As Integer
myAsc = Asc(strString)
If myAsc >= 48 And myAsc <= 57 Then
CheckNumber = True
Else
CheckNumber = False
End If
End Function
How about
Code:If IsNumeric(Left$(My_String,1)) = True Then
'It's numeric !
Else
' It's Not !
End If
ok, that way is easier but i didn't know about it :(