Exit Do Until Loop : Do Until « Language Basics « VBA / Excel / Access / Word






Exit Do Until Loop

 
   Sub AskForPassword4() 
       Dim pWord As String 

       pWord = "" 
       Do Until pWord = "DADA" 
           pWord = InputBox("What is the Report password?") 
           If pWord = "" Then Exit Do 
       Loop 
   End Sub 

 








Related examples in the same category

1.Do Loop Until
2.Using the Do...Until Loop
3.Using the Do...Until Loop with a Condition at the Bottom of the Loop
4.Use Do Until with if statement