Sub test()
Dim myArray, myString As String, n As Long, msg
myArray = [{"a","b","c","d","e"}]
myString = "y x q z b a"
For Each e In myArray
If InStr(1, myString, e, 1)>0 Then
msg = e
End If
n = n + 1
Next
MsgBox IIf(Len(msg)>0, msg & vbLf & n + 1, "Not Found")
End Sub
Hi & Welcome to the Board!
Does the following work for you? It is an array formula that needs to be entered with Ctrl+Shift+Enter:
Excel Workbook
A 1 y x q z b a 2 3 1 Sheet1
Hi,
please read this article on cross-posting :http://www.excelguru.ca/node/7
http://www.excelforum.com/showthread.php?t=609574