Slowing Down a Macro

T

tedd13

Hello,

I am wondering if it is possible to slow the speed down on how fast a macro
runs. For example, if you bring up the VB Editor and press the F8 key the
macro will run as long as you hold down the key (or you can just press the
key over and over). Doing this lets you see what is going on as the macro
runs.
However, if you press the play button the macro will run...very fast. It
runs so fast that you can't see what's going on.
So is there a way to slow down how fast it runs? In some cases I would like
the users to be able to see what the macro is doing.

Thanks
 
T

tedd13

That worked!
Thanks Jim

Jim Thomlinson said:
You have to insert wait times. Here is a quick (or rather slow) example...
Run the test sub...

Public Sub Pause(ByVal WaitTime As Integer)
Application.Wait Now + TimeSerial(0, 0, WaitTime)
End Sub

Sub test()
MsgBox 1
Pause 2
MsgBox 2
Pause 4
MsgBox 3
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top