ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   List Arrays of a Certain Size (https://www.excelbanter.com/excel-programming/329114-list-arrays-certain-size.html)

Stratuser

List Arrays of a Certain Size
 
I have a subroutine that uses a two-dimensional array to get data with which
I create a complicated chart. I would like to use this same subroutine on
about 25 other arrays of similar size, by just varying the name of the array
used by the subroutine. I am thinking of creating a listbox showing active
two-dimensional arrays, and plugging the chosen array name into the
subroutine. How would I get VBA to create a list of two-dimensional arrays
that currently exist in memory so that I could feed that list into a listbox?
Any ideas will be appreciated.

RB Smissaert

List Arrays of a Certain Size
 
How about something like this:

Sub test()

Dim coll As Collection
Dim arr1(1 To 100, 1 To 5) As Long
Dim arr2(1 To 100, 1 To 6) As Long
Dim arrGraph

Set coll = New Collection

coll.Add arr1
coll.Add arr2

arrGraph = coll(UserForm1.ListBox1.ListIndex)

End Sub

RBS


"Stratuser" wrote in message
...
I have a subroutine that uses a two-dimensional array to get data with
which
I create a complicated chart. I would like to use this same subroutine on
about 25 other arrays of similar size, by just varying the name of the
array
used by the subroutine. I am thinking of creating a listbox showing
active
two-dimensional arrays, and plugging the chosen array name into the
subroutine. How would I get VBA to create a list of two-dimensional
arrays
that currently exist in memory so that I could feed that list into a
listbox?
Any ideas will be appreciated.



Mickey Mouse[_4_]

List Arrays of a Certain Size
 

"RB Smissaert" wrote in message
...
How about something like this:

Sub test()

Dim coll As Collection
Dim arr1(1 To 100, 1 To 5) As Long
Dim arr2(1 To 100, 1 To 6) As Long
Dim arrGraph

Set coll = New Collection

coll.Add arr1
coll.Add arr2

arrGraph = coll(UserForm1.ListBox1.ListIndex)

End Sub

RBS


"Stratuser" wrote in message
...
I have a subroutine that uses a two-dimensional array to get data with
which
I create a complicated chart. I would like to use this same subroutine
on
about 25 other arrays of similar size, by just varying the name of the
array
used by the subroutine. I am thinking of creating a listbox showing
active
two-dimensional arrays, and plugging the chosen array name into the
subroutine. How would I get VBA to create a list of two-dimensional
arrays
that currently exist in memory so that I could feed that list into a
listbox?
Any ideas will be appreciated.






All times are GMT +1. The time now is 05:36 PM.

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