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/