As the OP and just for the record, the only thing I found that would really
speed up the code was to switch to arrays and do the looping internally
rather than in the spreadsheet; I find that arrays run as fast as ever, but
looping through cells, even using all the suggestions in these posts, is
still WAY TOO SLOW to be practical in Office 2007.
Use ARRAYS!!!
Thanks for all the interest, posts, replies, and side threads!
"Bob Flanagan" wrote:
I just came across the following article:
http://blogs.msdn.com/excel/archive/...-in-excel.aspx
Basically, it implies one should define variables as Variant versus Range
and get 6X faster reads and writes. I suspect that their testing was a
little flawed, but it is worth testing.
Robert Flanagan
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
"XP" wrote in message
...
Using Office XP with Office 2007.
I have a severe slow down in my code when using any For Each...Next
structure, such as "For Each Cell" or "For x = 1 to 10000"...
This slow down seems to be only in Office 2007. In 2003, my code runs like
a
machine gun; in 2007 it's more like a burp, wait a second, burp, wait a
second...etc.
This is the same code on the same machine so I'm sure my code is not to
blame since it has always run fine in 2003. At this pace, a program that
used
to run in a few seconds could now take several minutes.
Has anyone got a fix or any ideas how to make it run faster?
Thanks much for your assistance/guidance.