To reduce the speed of circulation in a range of cells

J

Jack clav

Jeanmi
Hello,

I have made a program which circulates in a range of cells.
I would like to reduce the speed of execution. I would like that the
selection of the cells don't go so quickly.
Is it possible and what must I do?


Thank you in advance,


Jean-michel






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

Deborah Digby

try putting the information into an array then transferring the contents of
the array to the range. I assume you are using a loop to fill the range.
Loop through the array, then use a statement like:
Range("whatever") = myArray
(this approx 100 times faster than looping through a range)

Obviously, you need to work out the dimensions involved, Redim-ing
dynamically if necessary. Also if the array is one-dimensional you will need
to use application.transpose(myArray)

D
 
U

urkec

You can use the Timer function:

Sub ToggleCells()

sleepTime = 1 'seconds

'toggle active cell 10 times
For i = 1 To 10

If i Mod 2 = 0 Then
Cells(1, 1).Activate
Else
Cells(2, 2).Activate
End If

Start = Timer

Do While Timer < Start + sleepTime
DoEvents
Loop

Next

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