Mega Code Archive

 
Categories / VisualBasic Script / Language Basics
 

Put InputBox in a Do Loop

Sub ifTest7()     Dim strMessage As String     Dim intTest As Integer     intTest = 1     Do         intNum = 4         If intNum >= 1 And intNum <= 15 Then             msgBox "the number is between 1 and 15"             intTest = 2         Else             msgBox "Sorry, the number must be between 1 and 15"             intTest = 3         End If     Loop While intTest = 1 End Sub