You would use the UBound function normally. UBound stands for upper bound
and refers to the upper limit of an array. If your array is 0 based and you
have 10 elements in it, the function x = UBound(myarray()) would return 9,
indicating that myarray(9) was the upper bound of the array, or you that you
have ten elements in the array (assuming that all the array items were
filled from 0 to 9).
HTH
Steve Arbaugh
ATTAC Consulting Group
web: http://ourworld.compuserve.com/homepages/attac-cg/acgsoft.htm
Reply Address adjusted to control spams remove leading ~ and NoSpm from
address
Send Replys to: ~75323...@NoSpm.Compuserve.com
dim x(9) not dim x(10) (unless you have specified Option Base 1 in your
module)
Dim intCounter As Integer
lngCount as Integer
lngCount = 0
For intCounter = LBound(arrayName) To UBound(arrayName)
If Not IsNull(arrayName(intCounter)) Then
lngCount = lngCount + 1
End If
Next intCounter
'lngCount = number of items in the array
Internetje wrote in message <348680...@solair1.inter.NL.net>...
>How can I count the number of items in an array? The array contains a
>list of salaries i.e. 20005, 30500, 36780, 40060
>
>Some people said that I should use Lbound and Ubound(???? What's that?
>The help file about Ubound/Lbound is missing)
>
>
>Joost
The dimension argument is a hole number indicating which dimension's lower
or upper bound is returned. Use 1 for the first dimension, 2 for the
second, and so on. If dimension is omitted, 1 is assumed.
David Winters wrote in message ...