is there a function that checks if a string is only letters and numbers?
kindof like isnumeric() but includes letters too.
and if there isn't a function that does letters and numbers, is there one that just checks for letters?
thanks very much!
Printable View
is there a function that checks if a string is only letters and numbers?
kindof like isnumeric() but includes letters too.
and if there isn't a function that does letters and numbers, is there one that just checks for letters?
thanks very much!
ISNUMERIC(?) will check for numbers..
You could use MASKEDEDITBOX to control what the users enters...
check dis out fa letters
respectVB Code:
Public Function IsAlpha(str As String) As Boolean 'only likes A-Z or a-z Dim i As Long For i = 1 To Len(str) If Asc(Mid$(str, i, 1)) >= 65 And Asc(Mid$(str, i, 1)) <= 90 Or Asc(Mid$(str, i, 1)) >= 97 And Asc(Mid$(str, i, 1)) <= 122 Then 'it's good! Else IsAlpha = False Exit Function End If Next i IsAlpha = True End Function Private Sub Command1_Click() MsgBox IsAlpha("hello") 'returns true MsgBox IsAlpha("hello1") 'returns false End Sub
how do i use MASKEDEDITBOX?
maskededitbox is mingin'
use da code to check for da letters
fa da numbers, use da IsNumeric function
Respect