Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I suspect you misunderstand what that means.
In my worksheet, where A65536 is blank, this following takes no time at all, as it's tryinng to count down from 0 to 1. Dim i As Long For i = Range("A65536") To 1 Step -1 MsgBox "hello, world" Next i I suspect you are thinking in terms of looping throught the rows. If so, the looping takes almost no time at all. It's what you do in the loop that counts. Try pasting the following sub into a module and run it, to see what I mean. Sub test() Dim i As Long Dim msg$ msg$ = Now & vbLf msg$ = Now & vbLf For i = Range("A65536").Row To 1 Step -1 'do nothing Next i MsgBox msg$ & Now, , "Doing nothing" ' msg$ = Now & vbLf For i = Range("A65536").Row To 1 Step -1 Application.StatusBar = i Next i MsgBox msg$ & Now, , "Doing a little bit" Application.StatusBar = False End Sub scain2004 < wrote: What looping method is the fastest if you have nested loops? I've got several ( For i = Range("A65536") To 1 Step -1 ) loops that take forever to run. Any suggestions on how to speed this up? --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2000 so slow in vista | Excel Discussion (Misc queries) | |||
Excel 2000 worksheet scrolling is very slow | Excel Discussion (Misc queries) | |||
Excel 2000 file slow to open--nearly 5 minutes! | Excel Discussion (Misc queries) | |||
Excel 2000 macro for page format slow | Excel Discussion (Misc queries) | |||
Slow Draw with Excel VBA 2000 | Excel Programming |