Quick question, for the below, the second loop is faster than the first.
Is this due to the overhead associated with the Variant type? - Granted it's not much slower though 
Sub DirectArray()
Dim arr(1 To 10000) As Long
Dim rngArr
Dim x As Long
Dim y As Long
Dim t As Class1
For x = 1 To 10000
arr(x) = x
Next x
rngArr = Application.Transpose(Sheet2.Range("A1:A10000").Value)
Set t = New Class1
With t
.StartCounter
For x = 1 To 10000
y = rngArr(x) + y
Next x
Debug.Print "rngArr: " & .TimeElapsed
y = 0
.StartCounter
For x = 1 To 10000
y = arr(x) + y
Next x
Debug.Print "arr: " & .TimeElapsed
End With
End Sub
Bookmarks