...若是字母,再判断是“大写字母”还是“小写字母”
发布网友
发布时间:2024-07-03 07:24
我来回答
共5个回答
热心网友
时间:2024-08-27 09:44
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 & " 为大写字母"
热心网友
时间:2024-08-27 09:43
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
热心网友
时间:2024-08-27 09:41
这个可以
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
热心网友
时间:2024-08-27 09:44
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
热心网友
时间:2024-08-27 09:39
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
&
"
为大写字母"
热心网友
时间:2024-08-27 09:40
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 & " 为大写字母"
热心网友
时间:2024-08-27 09:44
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
&
"
为大写字母"
热心网友
时间:2024-08-27 09:40
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
热心网友
时间:2024-08-27 09:41
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
热心网友
时间:2024-08-27 09:45
这个可以
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
热心网友
时间:2024-08-27 09:45
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 & " 为大写字母"
热心网友
时间:2024-08-27 09:42
这个可以
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
热心网友
时间:2024-08-27 09:44
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
&
"
为大写字母"
热心网友
时间:2024-08-27 09:46
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
热心网友
时间:2024-08-27 09:39
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