编写函数fun,函数的功能是判断一个字母

2024-11-17 13:52:07
推荐回答(1个)
回答1:

Private Function mYfun(strMy As String) As String
Dim strA As String
Dim intA As Integer
strA = Mid(strMy, 1, 1) 取第一个字符
intA = Asc(strA)
If intA > 64 And intA < 91 Or intA > 96 And intA < 123 Then
mYfun = strA & " 是字母"
ElseIf intA > 47 And intA < 58 Then
mYfun = strA & " 是数字"
Else
mYfun = strA & " 是其它"
End If
End Function