Option
Explicit
Sub
Demo()
Dim
a1
As
Variant
Dim
a2
As
Variant
Dim
a3
As
Variant
a1 = Range(
"A1:C2"
).Value
a2 = Range(
"A1:C1"
).Value
a3 = Range(
"A1:A2"
).Value
Debug.Print
"a1"
,
"(rows: "
& UBound(a1, 1) &
"; cols: "
& UBound(a1, 2) &
")"
Debug.Print
"a2"
,
"(rows: "
& UBound(a2, 1) &
"; cols: "
& UBound(a2, 2) &
")"
Debug.Print
"a3"
,
"(rows: "
& UBound(a3, 1) &
"; cols: "
& UBound(a3, 2) &
")"
a1 = WorksheetFunction.Transpose(a1)
a2 = WorksheetFunction.Transpose(a2)
a3 = WorksheetFunction.Transpose(a3)
Debug.Print
"a1^T"
,
"(rows: "
& UBound(a1, 1) &
"; cols: "
& UBound(a1, 2) &
")"
Debug.Print
"a2^T"
,
"(rows: "
& UBound(a2, 1) &
"; cols: "
& UBound(a2, 2) &
")"
Debug.Print
"a3^T"
,
"(nElem: "
& UBound(a3, 1) &
")"
End
Sub