Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extracting nth element of X dimension

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/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Extracting nth element of X dimension

there is no concept of currently is associated with an array.

Define a constant and use that as the value for the second dimension. Then
you can query the value of the constant

Public Const Myval As Long = 9

Sub ShowConst()
MsgBox Myval
Array1(Counter1, Myval, Counter2, Counter3, Counter4) = 250
End Sub

--
Regards,
Tom Ogilvy

ExcelMonkey wrote in message
...
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/



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
3 dimension chart jack Charts and Charting in Excel 2 December 9th 08 01:43 AM
two dimension look up table Dave Jepson Excel Worksheet Functions 1 October 26th 06 01:03 PM
3 dimension lookup problem barkiny Excel Worksheet Functions 1 March 14th 06 03:05 PM
Matrix Dimension Michelle Excel Worksheet Functions 1 November 24th 05 05:45 PM
Dimension problem APH Excel Programming 5 December 12th 03 11:23 PM


All times are GMT +1. The time now is 07:41 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"