turn of the automaitic calculations
application.calclation = xlmanual
'Your code
application.calculation = xlAutomatic
end sub
--
HTH...
Jim Thomlinson
"bozo the clown" wrote:
> I am trying to write a loop. If a condition is met then run the code and
> return back to the "do if" statement. I have one that works but it maxs out
> the cpu and is slow(see below). Is there anything better?
>
> Sub Time_set()
> If Range("A65536") < Range("A65536").Offset(0, 2) Then
> Range("A39999:AD39999").Select
> Selection.Delete Shift:=xlUp
> Range("C65536").Select
> ActiveCell.FormulaR1C1 = "=CURRENCIES!R[-65535]C"
> Range("D65536").Select
> ActiveCell.FormulaR1C1 = "=CURRENCIES!R[-65535]C[-2]"
> ActiveCell.Offset(0, -1).Range("A1:B1").Select
> Selection.Copy
> ActiveCell.Offset(0, -2).Range("A1").Select
> ActiveCell.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
> False, Transpose:=False
>
> Range("E65535:AD65535").Select
> Selection.AutoFill Destination:=Range("E65535:AD65536"), Type:= _
> xlFillDefault
> Range("E65535:AD65536").Select
> Else
>
> End If
> Application.OnTime Now + TimeValue("00:00:01"), "time_set"
>
> End Sub
Bookmarks