VB Code:
Public Function SearchArray(ByRef strArray() As String, ByVal strSearchFor As String) As Integer
Dim I As Integer
For I = 0 To UBound(strArray) ' count from 0 to the last string in the array
If InStr(strArray(I), strSearchFor, CompareMethod.Text) <> 0 Then
'InStr returns 0 if the string is not found in it
Return I ' return the Index of the string in the array
End If
Next
'If were still here then that mean that there is no strSearchFor in any of the strings
'In the array
Return -1
End Function