Thread: cancel the loop
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default cancel the loop

do
iresult = inputbox(...)
if trim(iresult) = "" then
exit do
end if
'rest of stuff
loop



Terry wrote:

I have set up a loop to prepare selected reports for appropriate location(s).
When I have printed all of the reports I want and select "CANCEL", how do I
set up the program to cancel the loop?

'
Dim iResult As Integer

Sheets("Mail List").Select
Do
iResult = InputBox("Please enter the Store Number:")
Range("a15").Value = iResult
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Loop

End Sub

Thanks in advance!!!


--

Dave Peterson