Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM
ReDim Object array as parameter of Variant array Peter T Excel Programming 4 May 10th 05 02:11 PM
Variant Array Steph[_3_] Excel Programming 1 June 2nd 04 01:29 AM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 06:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"