Article ID: 164234
Article Last Modified on 1/19/2007
Sub InfiniteLoop()
Dim n As Integer
n = 0
Msgbox ("WARNING: This macro will cause an infinite loop. Press" & _
CTRL+BREAK to exit an infinite loop.")
Do
' Because the "Do...Loop" is looking for the value of 'n'
' to equal 1, and because there is no code within the loop
' to change the value of the variable 'n' from it's initial
' value of zero, the "Do...Loop" will continue to loop indefinitely.
Loop Until n = 1
End Sub
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: wordcon vb vbe vba
Keywords: kbinfo kbprogramming kbusage KB164234