Public Function MatrixTranspose() Function MatrixTranspose(arrValue As Variant) As String() Dim i As Long, j As Long, rows As Long, column As Long Dim ReturnValue() As String rows = UBound(arrValue, 1) column = UBound(arrValue, 2) ReDim ReturnValue(1 To column, 1 To rows) For i = LBound(arrValue) To rows For j = LBound(arrValue) To column ReturnValue(j, i) = arrValue(i, j) Next Next MatrixTranspose = ReturnValue ReDim DataArray(1 To j - 1, 1 To i - 1) End Function