Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Whoa horsie Slow down

Can anyone tell me how to slow down macro or choose how
fast a macro runs. If you have a macro with screen
updating turned on I want it to slow down enough to view
the date being entered.

Any ideas on this.
Pete
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Whoa horsie Slow down

Pete

not something people are usually looking for. Try something like this:

Sub SlowDownTest()
Range("A1") = "a"
SlowDownLoop
Range("B1") = "b"
SlowDownLoop
Range("C1") = "c"
SlowDownLoop
Range("D1") = "d"
SlowDownLoop
Range("E1") = "e"
SlowDownLoop
End Sub

Private Sub SlowDownLoop()
Const LoopCount = 10000000
Dim i As Long
For i = 1 To LoopCount
Next i
End Sub

Vary the value of LoopCount to match your needs. You might need to add a
zero or double the value, etc.

Regards

Trevor


"Pete" wrote in message
...
Can anyone tell me how to slow down macro or choose how
fast a macro runs. If you have a macro with screen
updating turned on I want it to slow down enough to view
the date being entered.

Any ideas on this.
Pete



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Whoa horsie Slow down

Pete,
Another way from mskb 162150 ...

Use an API call to suspend execution for a fixed amount of time.
The Kernel32 contains a function that pauses a program's execution for a
specified amount of time, specified in milliseconds. To use the function, it
must first be declared in the General Declarations section of the module in
which it will be used:
'--------------------------------------------------
Declare Sub Sleep Lib "kernel32" Alias "Sleep" _
(ByVal dwMilliseconds As Long)

'Use the following syntax to call the Sleep function:
Sub Sleep()
Sleep 1000 'Implements a 1 second delay
End Sub
'--------------------------------------------------
Regards,
Jim Cone
San Francisco, CA

"Pete" wrote in message
...
Can anyone tell me how to slow down macro or choose how
fast a macro runs. If you have a macro with screen
updating turned on I want it to slow down enough to view
the date being entered.
Any ideas on this.
Pete



  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Whoa horsie Slow down

Trevor

I can't get the second option you suggested to work
properly without running in a massive continous loop. here
is my code below, can you get to work? What i want to see
is where the words "No Match are insert in my first range.
But I don't want it to fly by soo fast that the user can't
reconize it.

Application.ScreenUpdating = True

Set MyFirstRange = Range("z3:z220")
Set MySecondRange = Range("b3:b220")
fnd = 0

For Each c In MyFirstRange
For Each n In MySecondRange
If c.Value = n.Value Then
c.Offset(0, 4).Value = n.Offset(0, 4).Value
fnd = 1
End If
Next
If fnd = 0 Then c.Offset(0, 4).Value = "No Match"
fnd = 0
Next

Thanks
Pete

-----Original Message-----
Pete

not something people are usually looking for. Try

something like this:

Sub SlowDownTest()
Range("A1") = "a"
SlowDownLoop
Range("B1") = "b"
SlowDownLoop
Range("C1") = "c"
SlowDownLoop
Range("D1") = "d"
SlowDownLoop
Range("E1") = "e"
SlowDownLoop
End Sub

Private Sub SlowDownLoop()
Const LoopCount = 10000000
Dim i As Long
For i = 1 To LoopCount
Next i
End Sub

Vary the value of LoopCount to match your needs. You

might need to add a
zero or double the value, etc.

Regards

Trevor


"Pete" wrote in

message
...
Can anyone tell me how to slow down macro or choose how
fast a macro runs. If you have a macro with screen
updating turned on I want it to slow down enough to view
the date being entered.

Any ideas on this.
Pete



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Whoa horsie Slow down

Not sure I understand "second option". The first piece of code simply
demonstrates the SlowDownLoop subroutine. In your example, I think you need
to put the call to the subroutine as shown.

For Each c In MyFirstRange
For Each n In MySecondRange
If c.Value = n.Value Then
c.Offset(0, 4).Value = n.Offset(0, 4).Value
fnd = 1
End If
Next
If fnd = 0 Then
c.Offset(0, 4).Value = "No Match"
SlowDownLoop
End If
fnd = 0

Next

Regards

Trevor


wrote in message
...
Trevor

I can't get the second option you suggested to work
properly without running in a massive continous loop. here
is my code below, can you get to work? What i want to see
is where the words "No Match are insert in my first range.
But I don't want it to fly by soo fast that the user can't
reconize it.

Application.ScreenUpdating = True

Set MyFirstRange = Range("z3:z220")
Set MySecondRange = Range("b3:b220")
fnd = 0

For Each c In MyFirstRange
For Each n In MySecondRange
If c.Value = n.Value Then
c.Offset(0, 4).Value = n.Offset(0, 4).Value
fnd = 1
End If
Next
If fnd = 0 Then c.Offset(0, 4).Value = "No Match"
fnd = 0
Next

Thanks
Pete

-----Original Message-----
Pete

not something people are usually looking for. Try

something like this:

Sub SlowDownTest()
Range("A1") = "a"
SlowDownLoop
Range("B1") = "b"
SlowDownLoop
Range("C1") = "c"
SlowDownLoop
Range("D1") = "d"
SlowDownLoop
Range("E1") = "e"
SlowDownLoop
End Sub

Private Sub SlowDownLoop()
Const LoopCount = 10000000
Dim i As Long
For i = 1 To LoopCount
Next i
End Sub

Vary the value of LoopCount to match your needs. You

might need to add a
zero or double the value, etc.

Regards

Trevor


"Pete" wrote in

message
...
Can anyone tell me how to slow down macro or choose how
fast a macro runs. If you have a macro with screen
updating turned on I want it to slow down enough to view
the date being entered.

Any ideas on this.
Pete



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Whoa horsie Slow down

I'm surprised nobody has suggested this yet, but have a
look at the Wait method in your Excel Help.

-----Original Message-----
Can anyone tell me how to slow down macro or choose how
fast a macro runs. If you have a macro with screen
updating turned on I want it to slow down enough to view
the date being entered.

Any ideas on this.
Pete
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow Tab Tony7659 Excel Discussion (Misc queries) 0 August 5th 09 09:49 PM
Slow Excel Navigation with Up / Down Arrow and slow scrolling deddog Excel Discussion (Misc queries) 0 August 14th 07 09:56 PM
Why Del is Slow Ananth Excel Discussion (Misc queries) 2 August 3rd 07 04:26 PM
Why so slow max Excel Discussion (Misc queries) 1 February 27th 06 02:38 PM
Slow Down... James Rose[_3_] Excel Programming 3 December 24th 03 06:44 PM


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"