transferring array to range
One example. Since the array is one dimension, must use Transpose for a
column of data (not required when referencing a row of data or 2D reference).
Sub test()
Dim rngData As Range
Dim arrData As Variant
Dim i As Long
Set rngData = Range("A1:A10")
arrData = Application.Transpose(rngData.Value)
For i = LBound(arrData) To UBound(arrData)
If IsNumeric(arrData(i)) Then _
arrData(i) = arrData(i) * 2
Next i
rngData.Value = Application.Transpose(arrData)
End Sub
"JackRnl" wrote:
A worksheet contains 10000 rows containing each 10 groups of (9 columns
of values PLUS 1 empty column).
I want to define a range for each group and load them into an (integer)
array. After performing some calculations and changing some values of
the array I would like to write the array back into the range.
How can I read the values into the array and how can I store the values
onto the range efficiently?
|