Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
array
Any tip to test the lenght of an array ?
nLenArray = 100 nColArray = 4 Redim tSociety(nLenArray,nColArray) For x = 1 to nLenArray For j = 1 to nColArray next next Why not possible for x = 1 to len(tSociety()) or something similar? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
array
I think you're referring to dimensions. Look at the LBound and UBound
functions. -- Vasant "JMG" wrote in message oups.com... Any tip to test the lenght of an array ? nLenArray = 100 nColArray = 4 Redim tSociety(nLenArray,nColArray) For x = 1 to nLenArray For j = 1 to nColArray next next Why not possible for x = 1 to len(tSociety()) or something similar? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
array
The UBound function does just what you want. UBound(tSociety,1) gives the
first dimension, UBound(tSociety,2) gives the second. "JMG" wrote: Any tip to test the lenght of an array ? nLenArray = 100 nColArray = 4 Redim tSociety(nLenArray,nColArray) For x = 1 to nLenArray For j = 1 to nColArray next next Why not possible for x = 1 to len(tSociety()) or something similar? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
array
UBound(tSociety) - LBound(tSociety) + 1 to get the length
For x = LBound(tSociety) To UBound(tSociety) to loop through it -- HTH Bob Phillips "JMG" wrote in message oups.com... Any tip to test the lenght of an array ? nLenArray = 100 nColArray = 4 Redim tSociety(nLenArray,nColArray) For x = 1 to nLenArray For j = 1 to nColArray next next Why not possible for x = 1 to len(tSociety()) or something similar? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Complex conditional summing - array COUNT works, array SUM gives#VALUE | Excel Worksheet Functions | |||
Prevent cell/array references from changing when altering/moving thecell/array | Excel Discussion (Misc queries) | |||
meaning of : IF(Switch; Average(array A, array B); array A) | Excel Worksheet Functions | |||
SEARCH EXCEL ARRAY FOR NON-VOIDS AND ENTER INTO ANOTHER ARRAY, | Excel Programming | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming |