5D Array using Name reference

  • Thread starter Thread starter K
  • Start date Start date
K

K

I currently us a 4D array to mirror an Excel database consisting of

* folder,
* workbook (with one worksheet),
* rows and columns


Private Type MasterArray
FolderNumber as Integer 'This is a number representing the
folder name
WorkBookNumber as Integer This is a number representing the
workbook.worksheet
Values as Variant 'Values (r,c) are the row
and column numbers on the worksheet
End Type

Dim mMasterArray ( ) as MasterArray

mMasterArray (FolderNumber,WorkBookNumber). Values (r,c)

I want to now extend this to a 5D array , so I can add one more
dimension to accommodate different worksheets in a workbook.

I have two questions.


1. Do I just add WorksheetNumber as Integer to the above type list ,
resulting in
mMasterArray(FolderNumber,WorkBookNumber,WorksheetNumber).Values (x,y)

2. Instead of numbers can I just define FolderName as String, and use a
name instead of a number as the reference.


Thank you very much for any ideas

K
 
I currently us a 4D array to mirror an Excel database consisting of

Sorry but all I see is a one-dimensional array. Just because it's an array
of a custom type having multiple elements doesn't make it multi-dimensional.
But anyway, sure, you can change the type of any element and add all the
elements you want. In fact, feel free to experiment<g>.
 
Looks like you are using an array of user defined structures. A 5D
array would be more like
dim myarr(#,#,#,#,#) as variant

Keith
www.kjtfs.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top