Mega Code Archive

 
Categories / VisualBasic Script / Language Basics
 

Combine several If structures using ElseIf

Sub ifTest4()       Dim intNum As Integer       intNum = 12       If intNum = 1 Then             Debug.Print "This is the lowest number"       ElseIf intNum = 15 Then             Debug.Print "This is the highest number"       Else             Debug.Print "The number is between 1 and 15"       End If End Sub