Please help I've search everywhere but it seems all methods failed. This is my Code
Dim MyArray(1 To 20) As Range
Dim A0 As Integer
Cells(1, 1).Select
For A0 = 1 To 20
Set MyArray(A0) = Range(ActiveCell, ActiveCell.Offset(1, 0))
ActiveCell.Offset(0, 1).Select
Next
Range("A15:T15") = Application.Transpose(MyArray)
Range("A15:T16") = Application.Transpose(MyArray)
Range("A15:T15") = WorksheetFunction.Transpose(MyArray)
Range("A15:T16") = WorksheetFunction.Transpose(MyArray)
I've tried every last 4 procedure/s. But failed. This is just summary to make it east to read. Thanks
Going a bit further than my comment ... try this as an example ...
Sub a()
Dim x(2) As Integer
x(0) = 1
x(1) = 2
Range("A10:B10").Value = x
End Sub
This correctly outputs the array into cells A10
and B10
In the case of a 2D array, you can use this example ...
Sub a()
Dim x(2,2) As Integer
x(0,0) = 1
x(0,1) = 2
x(1,0) = 3
x(1,1) = 4
Range("A10:B11").Value = x
End Sub
You still don't need transpose though!
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments