Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Resize a variant array
Hie,
I defined a class module with a variant Array member having "n" rows and "p" columns. In a method of the object, I need to resize the Array, in practice to add a row. So I had the idea of using the Redim instruction, ... but it doesn't work. Is there any solution to do this resizing operation ? ------------------------- MyClassObject ------------------------- Dim vaMyArray 'Data member ---- Sub MyMethod 'Method ..... Redim vaMyArray(UBound(vaMyArray,1) + 1, UBound(vaMyArray,2) '<= this doesn't work ..... End sub ------------------------ Thank you. Jean-Pierre Bidon Interstat 91 rue de Rennes 75006 Paris Tél: 01 45 49 19 17 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Resize a variant array
the solution would be to transpose your thinking.
rather than myarray(row,column) use myarray(column,row) then you can resize the last dimension. -- Regards, Tom Ogilvy "Jean-Pierre Bidon" wrote: Hie, I defined a class module with a variant Array member having "n" rows and "p" columns. In a method of the object, I need to resize the Array, in practice to add a row. So I had the idea of using the Redim instruction, ... but it doesn't work. Is there any solution to do this resizing operation ? ------------------------- MyClassObject ------------------------- Dim vaMyArray 'Data member ---- Sub MyMethod 'Method ..... Redim vaMyArray(UBound(vaMyArray,1) + 1, UBound(vaMyArray,2) '<= this doesn't work ..... End sub ------------------------ Thank you. Jean-Pierre Bidon Interstat 91 rue de Rennes 75006 Paris Tél: 01 45 49 19 17 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
ReDim Object array as parameter of Variant array | Excel Programming | |||
Variant Array | Excel Programming | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming |