Hi,
Not sure what your question is.
But, If you create a new function as below where we are calling the function and pass the parameters, it will search the string "dog" in array myanimals in the function and return the index/ position of substring.
Code
Sub callFunc()
Dim returnVal As Long
Dim myanimals(3) As String
myanimals(0) = "cat"
myanimals(1) = "dog"
myanimals(2) = "elephant"
'calling function and passing array and string to check
returnVal = IndexStrArray(myanimals, "dog")
MsgBox returnVal
End Sub
Display More
Thanks,
Saurabh