ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array of Public Arrays (https://www.excelbanter.com/excel-programming/321324-array-public-arrays.html)

Hari Prasadh

Array of Public Arrays
 
Hi,

How to define Array of Arrays where all the arrays are Public.

Problem is size of public array and the size of array of public arrays is
calculated programmatically (both are dynamic arrays).

I have used the Redim statement but not able to implement in this case.

--
Thanks a lot,
Hari
India



Tom Ogilvy

Array of Public Arrays
 
You don't declare an array of arrays

You declare an array of type variant, then assign arrays to its elements.

Public v() as Variant

sub Set array()

redim v(1 to 3)

v(1) = Array(1,2,3,4,5,6,7)
v(2) = Array("a","b","c")
v(3) = Array("Tom","Dick","Harry")

msgbox v(2)(3)

End Sub

--
Regards,
Tom Ogilvy

"Hari Prasadh" wrote in message
...
Hi,

How to define Array of Arrays where all the arrays are Public.

Problem is size of public array and the size of array of public arrays is
calculated programmatically (both are dynamic arrays).

I have used the Redim statement but not able to implement in this case.

--
Thanks a lot,
Hari
India






All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com