展开全部
Dim a As String
a = InputBox("输入一个字符,如果过位,系统将截取第一位,如果留空,系统取小写a")
If Len(a) = 0 Then
a = "a"
ElseIf Len(a) > 1 Then
a = Mid(a, 1, 1)
End If
If Asc(a) >= Asc("a") And Asc(a) <= Asc("z") Then MsgBox "字符 " & a & " 为小写字母"
If Asc(a) >= Asc("A") And Asc(a) <= Asc("Z") Then MsgBox "字符 " & a & " 为大写字母"
a = InputBox("输入一个字符,如果过位,系统将截取第一位,如果留空,系统取小写a")
If Len(a) = 0 Then
a = "a"
ElseIf Len(a) > 1 Then
a = Mid(a, 1, 1)
End If
If Asc(a) >= Asc("a") And Asc(a) <= Asc("z") Then MsgBox "字符 " & a & " 为小写字母"
If Asc(a) >= Asc("A") And Asc(a) <= Asc("Z") Then MsgBox "字符 " & a & " 为大写字母"
展开全部
这个可以
Private Sub Form_Load()
Dim a As String
a = Right(InputBox("输入"), 1)
Select Case Asc(a)
Case Asc("a") To Asc("z")
MsgBox "小写字母"
Case Asc("A") To Asc("Z")
MsgBox "大写字母"
Case Else
MsgBox "非字母"
End Select
End Sub
Private Sub Form_Load()
Dim a As String
a = Right(InputBox("输入"), 1)
Select Case Asc(a)
Case Asc("a") To Asc("z")
MsgBox "小写字母"
Case Asc("A") To Asc("Z")
MsgBox "大写字母"
Case Else
MsgBox "非字母"
End Select
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim
a
As
String
a
=
InputBox("输入一个字符,如果过位,系统将截取第一位,如果留空,系统取小写a")
If
Len(a)
=
0
Then
a
=
"a"
ElseIf
Len(a)
>
1
Then
a
=
Mid(a,
1,
1)
End
If
If
Asc(a)
>=
Asc("a")
And
Asc(a)
<=
Asc("z")
Then
MsgBox
"字符
"
&
a
&
"
为小写字母"
If
Asc(a)
>=
Asc("A")
And
Asc(a)
<=
Asc("Z")
Then
MsgBox
"字符
"
&
a
&
"
为大写字母"
a
As
String
a
=
InputBox("输入一个字符,如果过位,系统将截取第一位,如果留空,系统取小写a")
If
Len(a)
=
0
Then
a
=
"a"
ElseIf
Len(a)
>
1
Then
a
=
Mid(a,
1,
1)
End
If
If
Asc(a)
>=
Asc("a")
And
Asc(a)
<=
Asc("z")
Then
MsgBox
"字符
"
&
a
&
"
为小写字母"
If
Asc(a)
>=
Asc("A")
And
Asc(a)
<=
Asc("Z")
Then
MsgBox
"字符
"
&
a
&
"
为大写字母"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
Dim a As String
a = Left(InputBox("输入"), 1)
Select Case Asc(a)
Case Asc("0") To Asc("9")
MsgBox "数字"
Case Asc("a") To Asc("z")
MsgBox "小写字母"
Case Asc("A") To Asc("Z")
MsgBox "大写字母"
Case Else
MsgBox "其他字符"
End Select
End Sub
Dim a As String
a = Left(InputBox("输入"), 1)
Select Case Asc(a)
Case Asc("0") To Asc("9")
MsgBox "数字"
Case Asc("a") To Asc("z")
MsgBox "小写字母"
Case Asc("A") To Asc("Z")
MsgBox "大写字母"
Case Else
MsgBox "其他字符"
End Select
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim strTmp As String
Err1:
strTmp = InputBox("请输入一个字符:")
If Len(strTmp) > 1 Then GoTo Err1
If Len(strTmp) < 1 Then Exit Sub
If Not IsNumeric(strTmp) Then
If Asc(strTmp) >= Asc("a") And Asc(strTmp) <= Asc("z") Then
MsgBox "小写字母!"
ElseIf Asc(strTmp) >= Asc("A") And Asc(strTmp) <= Asc("Z") Then
MsgBox "大写字母!"
Else
MsgBox "非字母!"
End If
Else
MsgBox "非字母!"
End If
End Sub
Dim strTmp As String
Err1:
strTmp = InputBox("请输入一个字符:")
If Len(strTmp) > 1 Then GoTo Err1
If Len(strTmp) < 1 Then Exit Sub
If Not IsNumeric(strTmp) Then
If Asc(strTmp) >= Asc("a") And Asc(strTmp) <= Asc("z") Then
MsgBox "小写字母!"
ElseIf Asc(strTmp) >= Asc("A") And Asc(strTmp) <= Asc("Z") Then
MsgBox "大写字母!"
Else
MsgBox "非字母!"
End If
Else
MsgBox "非字母!"
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询