Hi,
I have to reorder my array and paste it to a sheet. I am trying to do this with a for loop that iterates over two index variables.
Sub example()
Dim MyArray() As Variant
Dim FirstElement As Range
Dim i As Integer
Dim j As Integer
Set FirstElement = Range("J1")
MyArray = Range(Cells(2, 2), Cells(17, 2)).Value
For i = 1 To 16
For j = 1 To 16 Step 2
FirstElement.Offset(j, 0).Value = MyArray(i, 1)
Next j
Next i
End Sub
But I dont get it to work. I have attached example of my array. That better explains what I am trying to accomplish.
Bookmarks