Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Slow Down the Macro to View

1 view
Skip to first unread message

Aria

unread,
Jan 31, 2007, 7:37:43 PM1/31/07
to
Hello,
Once a macro is triggered, it's incredibly fast. That's great and all.
However, what if I want the code to move slow enough so the other users
could see what it's doing every time ie. Cut and Paste (without Stepping
into the code and F8 through it all).

If it's possible, how would you do it?

Thanks,
Aria :)

*** Sent via Developersdex http://www.developersdex.com ***

marcus

unread,
Jan 31, 2007, 8:04:41 PM1/31/07
to
Hello Aria

This may be rather simplistic but if you place this line of code after
each line you want slowed it will take 2 seconds between each action.

Application.Wait Now + (TimeValue("00:00:02"))

Change to suit.

Take Care

Marcus

JMB

unread,
Jan 31, 2007, 8:15:00 PM1/31/07
to
check vba help for the wait method. perhaps put the code in a separate
subroutine and call it whenever you want it to slow down. For example, the
following test should activate each worksheet in the book with a 5 second
pause in between.


Sub test()
Dim wksTemp As Worksheet

For Each wksTemp In Sheets
wksTemp.Activate
Call TimeOut(0, 0, 5)
Next wksTemp
End Sub

Sub TimeOut(lngHour As Long, _
lngMinute As Long, _
lngSecond As Long)
Dim dblWaitTime As Double

dblWaitTime = Now() + TimeSerial(lngHour, _
lngMinute, lngSecond)

Application.Wait dblWaitTime

End Sub

Aria

unread,
Jan 31, 2007, 9:41:15 PM1/31/07
to
Thank-you so much JMB and Marcus,
Both are very good choices. I will try both of your suggestions. This
will help my work greatly.

Thanks again,

NickHK

unread,
Jan 31, 2007, 10:08:06 PM1/31/07
to
Aria,
Not sure if this is practical, but have you looked at a product like AutoIt,
http://www.autoitscript.com/.
As I remember, you can set the play back speed to the same as the recording.
However, I believe it works on screen coordinates, so if the users have
different resolutions, location of windows etc, you will not get reliable
results.
If this is to used on the same system, then it may work.

OK, not really an Excel/VBA solution, but...

NickHK

<Aria> wrote in message news:u$rlwkZRH...@TK2MSFTNGP02.phx.gbl...

0 new messages