Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the following function to transpose a 2d array in Excel 2003.
Public Function TransposeArray(arrIn As Variant) Dim i As Long, j As Long, lngUpperI As Long, lngUpperJ As Long, intLoweri As Integer, intLowerj As Integer, arrOut() As Variant lngUpperI = UBound(arrIn, 1) lngUpperJ = UBound(arrIn, 2) intLoweri = LBound(arrIn, 1) intLowerj = LBound(arrIn, 2) ReDim arrOut(intLowerj To lngUpperJ, intLoweri To lngUpperI) For i = intLoweri To lngUpperI For j = intLowerj To lngUpperJ arrOut(j, i) = arrIn(i, j) Next Next Set arrIn = Nothing TransposeArray = arrOut End Function The function usually works fine, but it generates an out of memory error message on a 190,000 by 4 2d array. I presume that is because the function is creating a new array, arrOut, that's as big as the incoming array, arrIn. Does anyone know how to break down such a function into digestible bits, so that it doesn't run out of memory? The worksheet function Application.Transpose is not an option, as it generates an error message after about 64,000 rows. Thanks, Wayne C. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Transpose array sum | Excel Worksheet Functions | |||
Transpose Array | Excel Discussion (Misc queries) | |||
create an array with unique items IN MEMORY | Excel Worksheet Functions | |||
does Excel have memory limit of data Array? | Excel Programming | |||
Excel: Array & Memory | Excel Programming |