Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
3 dimension chart | Charts and Charting in Excel | |||
two dimension look up table | Excel Worksheet Functions | |||
3 dimension lookup problem | Excel Worksheet Functions | |||
Matrix Dimension | Excel Worksheet Functions | |||
Dimension problem | Excel Programming |