Example:

  1. Sub Main ()

    1. Dim Value, Msg          ' Declare variables.

      Do

      1. Value = InputBox("Enter a value from 5 to 10.")

        If Value >= 5 And Value <= 10 Then

        1. Exit Do          ' Exit Do...Loop.

        Else

        1. Beep          ' Beep if not in range.

        End If

      Loop

    End Sub