Extracting nth element of X dimension

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: ExcelMonkey (ExcelMonkey.112zs4_at_excelforum-nospam.com)
Date: 02/04/04


Date: Tue, 3 Feb 2004 20:54:06 -0600

I have a 5D array. I have counters which I use for the first, third,
fourth, and fifth dimensions when I want to pass values into the array.
However, the length of the second dimension is changing constantly as
I build my routine and I have hard coded a number 9 in it currently. I
need to reference this 9 elsewhere. So as I decide to expand the 2nd
dimension to say 10, I will have to make sure that I change all the
other 9s to 10. Is there a way extract the value that is currently in
the second dimension (i.e. the 9) and pass it to a variable that I can
use elsewhere?

Array1(Counter1, 9, Counter2, Counter3, Counter4) = 250

SecondDimensionVariable = UBound(UnitOfferArray, 2) will only tell me
what I set the max to. I want to know what it currently is?

---
Message posted from http://www.ExcelForum.com/


Relevant Pages

  • Re: Error on UBound with Dynamic Array
    ... ReDim Preserve arrSplit+ 1) ... is that arrSplit has not yet been dimmed as having any dimension. ... need to use a dynamic array and may be checking the boundries, ... Public Function Split(csvString As String) As Variant ...
    (microsoft.public.access.modulesdaovba)
  • Re: Program Fails When Parameter Fixed Constants are Changed (F77) ??
    ... subroutine and then call DCpZeros passing VxGrid, nRdim, and nTHdim. ... Then DCpZeros can dimension VxGrid (nRdim, ... (PS. I'm not concerned or worried about the array bounds exceeded! ...
    (comp.lang.fortran)
  • Re: Array Dim
    ... The "dimension" of an array is how many numbers there are in the comma separated list between the parentheses. ... When using the array in code, each of the numbers in the parentheses are called the Index for that dimension. ... I'm going to give you a made up example to show how to declare a Type object and then show you how to use it. ... The Type Statement starts with the Type keyword and it is followed by the name you want to give to the structure that follows below it (here, I have chosen to call it EmployeeRecords) and ends with the End Type statement. ...
    (microsoft.public.excel.programming)
  • Re: Playing with multidimensional array!?
    ... In traditional compiler languages, rows and columns are differentiated by ... the fact that a two dimensional array occupies contiguous storage locations. ... fact that redim can affect only the last dimension. ... consider these the first dimension and the second dimension rather than row ...
    (microsoft.public.scripting.vbscript)
  • Re: Array of pointer Vs Pointer to Array
    ... that points to an array. ... Now 'pa' is a pointer form of accessing the values in 'matrix'. ... that depends on a variety of things - the size of the other dimension, ... the regular indexing style is a good first guess, ...
    (comp.lang.c)