ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   03 vs 07: speed with different methods of referencing ranges? (https://www.excelbanter.com/excel-programming/437472-03-vs-07-speed-different-methods-referencing-ranges.html)

ker_01

03 vs 07: speed with different methods of referencing ranges?
 
I did some minor testing on 2003 with bringing in arrays as reference vs
variant:

Dim rng As Range
Dim rng2 As Variant
RowCount = lastRow(Sheet2)

Set rng = Sheet2.Range("A1:Z" & RowCount)
rng2 = Sheet2.Range("A1:Z" & RowCount).Value

I then tested to see if processing on either was faster, using some simple
math calculations on my range content. For my sample data, they were within a
second of each other.

My workbook will likely be used by coworkers in another state who have 2007,
so I figured it would be wise to ask if anyone has noticed dramatic speed
differences in 2007 between processing data in one vs the other type of range
reference. I'll be working on some very large ranges later, so I want to make
sure I'm not shooting myself in the foot with whichever one I end up using.

Thanks,
Keith


Charles Williams

03 vs 07: speed with different methods of referencing ranges?
 
Excel 2007 was significantly slower than 2003, although Excel 2007 SP2 has
made things much better.
see http://www.decisionmodels.com/VersionCompare.htm for a detailed
comparison.

Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"ker_01" wrote in message
...
I did some minor testing on 2003 with bringing in arrays as reference vs
variant:

Dim rng As Range
Dim rng2 As Variant
RowCount = lastRow(Sheet2)

Set rng = Sheet2.Range("A1:Z" & RowCount)
rng2 = Sheet2.Range("A1:Z" & RowCount).Value

I then tested to see if processing on either was faster, using some simple
math calculations on my range content. For my sample data, they were
within a
second of each other.

My workbook will likely be used by coworkers in another state who have
2007,
so I figured it would be wise to ask if anyone has noticed dramatic speed
differences in 2007 between processing data in one vs the other type of
range
reference. I'll be working on some very large ranges later, so I want to
make
sure I'm not shooting myself in the foot with whichever one I end up
using.

Thanks,
Keith






All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com