View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
Craig & Co. Craig & Co. is offline
external usenet poster
 
Posts: 7
Default Number of Items in an Array.

Hi,

How do I find out the number of items in an array, so that I can loop check
the values in the array with the incoming data.

Dim Users as Variant
Dim NumValues, Counter as Integer
Users = Array("Bob","Fred")

NumValues = Users

For Counter = 0 to NumValues
CheckUser = Users(Counter)
If CheckUser = IncomingUser then
Print "Cool" - okay this is just pseudo code.
Else
Print "Not Cool"
End If
next

Cheers
Craig.