View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Duncan[_5_] Duncan[_5_] is offline
external usenet poster
 
Posts: 290
Default Pausing macros

" How do you get to the stop button?"

just putting "Stop" in your code

i.e,
sub Test ()
Msgbox "Hello"
Stop
Msgbox "Goodbye"
End Sub

im not sure how safe it is to use this command, I know not (NOT) to put
it in the before print sub because it brings up a well old error
message and crashes the pc, also this would require your intervention
to continue running the code (press play manually) and you did state
you wanted to leave the pc

there is the command Application.Wait(specify time) and you could put a
line like

Application.Wait( now() + timeserial(0,0,10) )

which if im right (havent tested this) should wait 10 seconds before
commencing.

For speeding up issues, im only a beginner so I will leave this to the
more experianced to answer.

Hope this helps

Duncan


CWillis wrote:

The "run" (play), "break" (pause) and "reset" (Stop) buttons are on the
"standard" toolbar in the VBA window. If you do not see them, right click on
the top toolbar, and go to "customize". Under the "commands" tab, scroll
through the "Categories" until you see "Run". Under "commands" the first
three buttons should be "Run", "Break", and "Reset". Drag and drop each to
your toolbar.

As for speeding up the code, that would depend on the code...

"phil2006" wrote:


How do you get to the stop button? My problem is that I'm running macros
that iI've estimated will take 10-15 hours at their current rate. I
could do with getting some sort of pause or speeding them up so that I
can leave the computer.

Thanks


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=556419