Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Redim Preserve doesn't work
I have so code (to array) and I use REDIM Preserve to make bigger
dynamic array, VBA give me error nr 9 subscribt out of range. What i do wrong with redim preserve? 'this is that code For int2 = 1 To 100 If int2 = 1 Then ReDim tbl2(1 To 1, 1 To 4) tbl2(int3, 1) = tab1(int2, 1) int3 = int3 + 1 Else ReDim Preserve tbl2(1 to int3,1 to 4) tbl2(int3, 1) = tab1(int2, 1) int3 = int3 + 1 End If Next int2 *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Redim Preserve doesn't work
ReDim Preserve only works on the final dimension of the array. For example:
ReDim Preserve tbl2(1 to 4, 1 to int2) Just reverse the dimensions. -- John Green Sydney Australia <Witek wrote in message ... I have so code (to array) and I use REDIM Preserve to make bigger dynamic array, VBA give me error nr 9 subscribt out of range. What i do wrong with redim preserve? 'this is that code For int2 = 1 To 100 If int2 = 1 Then ReDim tbl2(1 To 1, 1 To 4) tbl2(int3, 1) = tab1(int2, 1) int3 = int3 + 1 Else ReDim Preserve tbl2(1 to int3,1 to 4) tbl2(int3, 1) = tab1(int2, 1) int3 = int3 + 1 End If Next int2 *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Redim Preserve doesn't work
Have you any idea, How to redim more like one time array? (3, 50, 150
times? indepent of data. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Redim Preserve doesn't work
Preserve only works to change the right-most subscript, i.e.
Dim X(1 to 3, 1 to 10, 1 to 50) you can change the 50 up or down, not the 3, 10, or any of the 1's. On Mon, 01 Nov 2004 10:59:58 -0800, Witek <Witek wrote: Have you any idea, How to redim more like one time array? (3, 50, 150 times? indepent of data. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA syntax help: ReDim Preserve an array | Excel Discussion (Misc queries) | |||
ReDim, Preserve and Multidimensional arrays | Excel Programming | |||
Dim / Redim of an Array | Excel Programming | |||
ReDim an Array | Excel Programming | |||
Redim MyArray | Excel Programming |