#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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
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
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
SEARCH EXCEL ARRAY FOR NON-VOIDS AND ENTER INTO ANOTHER ARRAY, ROSE THE RED Excel Programming 1 December 31st 04 06:01 PM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 10:30 PM.

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

About Us

"It's about Microsoft Excel"