#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default do if loop

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

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
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 08:44 PM.

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

About Us

"It's about Microsoft Excel"