Skip to main content

Write a VB program to accept input from Textbox. Check whether given input is alphabet or number. If it is alphabet check that it is in uppercase or lowercase. Display appropriate result using msgbox.

· One min read
Kaustubh Kulkarni
file.vb
Private Sub Command1_Click()  
Dim no As String
no = Text1.Text
If Asc(no) < 91 And Asc(no) > 64 Then
MsgBox ("The given character is alphabet in UppercasLetter")
ElseIfAsc(no) < 123 And Asc(no) > 96 Then
MsgBox ("The given character is alphabet in Lowercaseletter")
ElseIfAsc(no) < 58 And Asc(no) > 47 Then
MsgBox ("The given character is number")
Else
MsgBox ("Enter Valid input")
End If
End Sub