View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach[_6_] Otto Moehrbach[_6_] is offline
external usenet poster
 
Posts: 201
Default Searching an Array

RB
Thanks for the help. I was hoping I could do it with a simple Find but,
alas, no joy. Otto
"RB Smissaert" wrote in message
...
Sub Test()

Dim arr(0 To 100, 0 To 200) As String
Dim i As Long
Dim c As Long

arr(50, 50) = "Harry"

For i = 0 To 100
For c = 0 To 200
If arr(i, c) = "Harry" Then
MsgBox "found Harry", , ""
Exit Sub
End If
Next
Next

End Sub


RBS

"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I built an array of people's names, say People().
I want to find out if Harry is in that array.
I don't want to find Harry's position within the array, just if he is

in
the array.
How would I code that search?

Thanks for your help. Otto