Mega Code Archive

 
Categories / VisualBasic Script / Language Basics
 

Use and in if statement

Sub ifTest3()     Dim intNum As Integer     Dim strMessage As String     intNum = 4     If intNum >= 1 And intNum <= 15 Then         msgBox "the number is between 1 and 15"     Else         msgBox "Sorry, the number must be between 1 and 15"     End If End Sub