Hi Jacob,
Good to see that You challenge arrays
If we don't insist to use an array of a specific datatype then I would prefer to use the following approach:
Option Explicit
Sub Variant_Array()
Dim wsSheet As Worksheet
Dim rnData As Range
Dim vaData As Variant
Dim i As Long, j As Long, k As Long
Set wsSheet = ActiveSheet
With wsSheet
Set rnData = .Range(.Range("A1"), .Range("C65536").End(xlUp))
End With
'Read all data into the array.
vaData = rnData.Value
'Variant-arrays that reads data from a range is always 1-based.
Debug.Print LBound(vaData)
Debug.Print UBound(vaData)
'Here we make a dummy addition just to loop through the array:
For j = 1 To 3
For i = 1 To UBound(vaData)
vaData(i, j) = vaData(i, j) * 2
Next i
Next j
'Read the revised data back to the range.
rnData.Value = vaData
End Sub
Hi Tommy,
Long time since I saw a RDO-approach as most people nowdays prefer ADO
Thank you for reading my post on this subject,
Dennis