Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Problem with Multi-Dimensional Array

I am getting a sub-script out of range error when trying
to populate my multi-dimensional array.

Below is the code for declaring the array as well as the
code to populate the code:
ReDim Preserve AppNames(0 To (ArrayCnter - 1), 0 To
(ArrayCnter - 1), 0 To (ArrayCnter - 1))

..
..
..
AppNames(j, 0) = cmbAppList.Text
AppNames(j, 1) = cmbWPA.Text
AppNames(j, 2) = AppLoc & "\" & cmbWPA.Text & "\" &
cmbAppList.Text

If I have just 2 values, this works fine, but I need it
to capture 3 values. Any ideas as to why this is not
working?

Any help would be appreciated.

Thanks.

Kirk

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Problem with Multi-Dimensional Array

Sorry
but you can only redim the last dimension, the other will
remain the same, That information come in the Help
The last dimension is the one of the right, so if you have
three dimensions, like AppNames(aDim,bDim,cDim) you can
change only the cDim value and must retain fixed the other
values, so you need to change your code


Francisco Mariscal
fcomariscal at hotmail dot com



-----Original Message-----
I am getting a sub-script out of range error when trying
to populate my multi-dimensional array.

Below is the code for declaring the array as well as the
code to populate the code:
ReDim Preserve AppNames(0 To (ArrayCnter - 1), 0 To
(ArrayCnter - 1), 0 To (ArrayCnter - 1))

..
..
..
AppNames(j, 0) = cmbAppList.Text
AppNames(j, 1) = cmbWPA.Text
AppNames(j, 2) = AppLoc & "\" & cmbWPA.Text & "\" &
cmbAppList.Text

If I have just 2 values, this works fine, but I need it
to capture 3 values. Any ideas as to why this is not
working?

Any help would be appreciated.

Thanks.

Kirk

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Problem with Multi-Dimensional Array

You dimensioned the array with 3 subscripts.

ReDim Preserve AppNames(0 To (ArrayCnter - 1), 0 To (ArrayCnter - 1), 0 To (ArrayCnter - 1))

Your assignment statements use only 2 subscripts.


On Tue, 26 Aug 2003 07:05:44 -0700, "Kirk" wrote:

I am getting a sub-script out of range error when trying
to populate my multi-dimensional array.

Below is the code for declaring the array as well as the
code to populate the code:

ReDim Preserve AppNames(0 To (ArrayCnter - 1), 0 To (ArrayCnter - 1), 0 To (ArrayCnter - 1))
.
.
.
AppNames(j, 0) = cmbAppList.Text
AppNames(j, 1) = cmbWPA.Text
AppNames(j, 2) = AppLoc & "\" & cmbWPA.Text & "\" &
cmbAppList.Text

If I have just 2 values, this works fine, but I need it
to capture 3 values. Any ideas as to why this is not
working?

Any help would be appreciated.

Thanks.

Kirk


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
Multi Dimensional Lookup coolkat Excel Discussion (Misc queries) 1 June 14th 11 11:48 PM
newbie question on multi-dimensional array sammus New Users to Excel 2 April 3rd 06 03:11 AM
How to declare Multi-dimensional dynamic array? Terence Excel Programming 1 August 11th 03 04:55 AM
Declaring Dynamic Multi-dimensional Array JohnV[_2_] Excel Programming 2 July 15th 03 06:58 PM
sort multi-dimensional array on numeric data? RB Smissaert Excel Programming 0 July 14th 03 10:49 PM


All times are GMT +1. The time now is 06:07 PM.

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"