Slow macro
Hi Alf!
I agree with Bob and Jim, but you *might* get better results if you knock
down copying/pasting and just assign the value on one cell to the other.
Guess you have two columns, AS has the address of values, and AT the address
where values must be written. If this is the case substitute everything
inside the loop by:
If cell.Value < "E" Then _
Range(cell.Offset(0, 1).Value) = Range(cell.Value)
Best,
Rafael
"alf bryn" wrote:
I have a maco with a number of loops in it that runs a bit slowly.
Recently I read a post in this NG that said :
Macros that work on the worksheet cells are slow.
You can greatly increase speed if you set up an array of the variant type
from you worksheet cells then use code that works with the array.
As my knowledge of arrays are minute I would be gratefull for a bit of
advice how to change my macro. Part of my original macro below.
Sub cdumacro()
Dim cell As Range
Application.ScreenUpdating = False
Application.Calculation = xlManual
For Each cell In Worksheets("cdu").Range("AS56:AS102")
If cell.Value < "E" Then
Range(cell.Value).Copy
Range(cell.Offset(0, 1).Value).PasteSpecial Paste:=xlValues
End If
Next cell
Alf
|