Simple Copy and Paste
Not sure exactly what you were trying to achieve, but the problem was
you did not
feed values to your array :(
Sub Macro2()
ActiveCell.Copy
Dim MyArray(1 To 20) As Variant
For v = 1 To 20
MyArray(v) = v
Next v
For i = 1 To 20
X = MyArray(i)
ActiveCell.Offset(1, X).Select
ActiveSheet.Paste
Next i
End Sub
But i would say, why use array, if the array value and array position
is identical?
look at code below.
Sub Macro_Mine()
ActiveCell.Copy
For i = 1 To 20
ActiveCell.Offset(1, i).Select
ActiveSheet.Paste
Next i
End Sub
|