Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Array Dimensioning

Please excuse my previous response.
Maybe I should get enough sleep before responding to questions.
If no lower bound is declared in an array then the lower bound is zero...
ReDim MyArr(100) is the same as ReDim MyArr(0 to 100)

I believe with seven dimensions in the array that you are having memory
problems. Arrays eat memory and multi-dimensional arrays are hungry.
You need to rethink your approach. In almost all cases, a two-dimensional
array should suffice... ReDim (0 to 30, 0 to 202)
--
Jim Cone
Portland, Oregon USA



"BillCPA" <Bill @ UAMS
wrote in message
Actually, I use the zero level of each element, so I want them to be 0 to nn.
Here is the pertinent code:

Public arrFile() As String - this is in Module 1
Public FldrNo0 As Integer - this is in Module 1; FldrNo1-6 are the same as 0

The following ReDim statement is in Module 3:
ReDim arrFile(FldrNo0, FldrNo1, FldrNo2, FldrNo3, FldrNo4, FldrNo5, (FldrNo6
+ 10))
(The array is not a passed parameter, and there is no other ReDim before
this.)

Currently, when the code gets to the ReDim, these are the values of FldrNon:
FldrNo0=30; FldrNo1=19; FldrNo2=51; FldrNo3=70;
FldrNo4=83; FldrNo5=168; FldrNo6=202

If I stop the run immediately after the ReDim statement, and check the
UBound of any of the elements, it shows 'Subscript out of Range'.
If I continue running until I populate the array, it executes the statement
(see below) that places a value into the array without giving any error, but
if I check the value in the array immediately after that statement, it shows
'Subscript out of Range'.

arrFile(FldrNo0, FldrNo1, FldrNo2, FldrNo3, FldrNo4, FldrNo5, FldrNo6) =
f0.Name

As I mentioned, it does exactly the same with 6 and 5 dimensions, but when I
get to 4 dimensions, it works fine.
Extremely frustrating.
--
Bill @ UAMS
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 dimensioning LesHurley Excel Programming 10 April 16th 09 08:34 AM
Excel VBA Compile Error when dimensioning jagged array EngPhys_Bate Excel Programming 2 August 22nd 07 03:28 AM
dimensioning variables Carla101 Excel Programming 8 January 11th 06 11:25 AM
dimensioning across modules Papa Jonah Excel Programming 1 February 16th 05 09:40 PM
Dimensioning Arrays Peter M[_3_] Excel Programming 2 December 13th 03 06:46 PM


All times are GMT +1. The time now is 09:14 AM.

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

About Us

"It's about Microsoft Excel"