LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Excel 2000 Slow Loops

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
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
Excel 2000 so slow in vista woodis Excel Discussion (Misc queries) 1 December 23rd 09 12:45 AM
Excel 2000 worksheet scrolling is very slow Bobc Excel Discussion (Misc queries) 0 December 8th 08 06:59 PM
Excel 2000 file slow to open--nearly 5 minutes! matt Excel Discussion (Misc queries) 0 July 18th 08 04:41 AM
Excel 2000 macro for page format slow [email protected] Excel Discussion (Misc queries) 2 October 6th 06 11:55 PM
Slow Draw with Excel VBA 2000 Evan Excel Programming 0 September 4th 03 09:34 PM


All times are GMT +1. The time now is 08:22 AM.

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

About Us

"It's about Microsoft Excel"