Struggling with the concept. Can anyone provide an example? Example. Start the loop and then have an input box asking if you want to continue the loop?
Struggling with the concept. Can anyone provide an example? Example. Start the loop and then have an input box asking if you want to continue the loop?
Peace of mind is found in some of the strangest places.
Doesn't sound complicated but I think we need a simple example.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
[VBA]Do
Rem some stuff
Loop Until MsgBox("Another Loop?", vbYesNo) = vbNo[/VBA]
Hi all,
I would imagine you meant a msgbox, but here's a simple example of either way.
MarkSub LoopCrazy() Dim i As Long, bolOkayIveHadEnough As Boolean Do i = i + 1 If Not MsgBox("We're in Loop #" & i & vbCrLf & _ "Do you want to continue?", vbYesNo, vbNullString) = vbYes Then bolOkayIveHadEnough = True End If Loop While Not bolOkayIveHadEnough End Sub Sub LoopyToo() Dim i As Long Do i = i + 1 Loop While InputBox("""Yes"" to continue" & vbCrLf & "Loop #" & i, "") = "Yes" End Sub
Thanks guys I got it.
Peace of mind is found in some of the strangest places.