Function mytranspose(Arr)
Dim k%, x, y, Brr
k = IIf(LBound(Arr) = 0, 1, 0) ''''區分arr下界是0是1
On Error Resume Next
x = UBound(Arr, 2)
On Error GoTo 0
If IsEmpty(x) Then ''''''''''''''''''''''''1維
ReDim Brr(1 To UBound(Arr) + k, 1 To 1)
For i = 1 To UBound(Arr)
Brr(i, 1) = Arr(i - k)
Next i
Else '''''''''''''''''''''''''''''''''''''''2維
x = UBound(Arr, 2)
y = UBound(Arr, 1)
ReDim Brr(1 To x + k, 1 To y + k)
For i = 1 To x + k
For j = 1 To y + k
Brr(i, j) = Arr(j - k, i - k)
Next j
Next i
End If