Hi KVS and all Experts.
Have a look, NthMatch Redefined
Function NthMatch(ByVal Lvalue As Variant, Lrange As Variant, Mnum As Variant)
Mstr = "|" & Join(Application.Transpose(Lrange), "|") & "|"
Start = 1
For c = 1 To Mnum
Found = InStr(Start, Mstr, Lvalue)
If Found = 0 Then NthMatch = "#N/A": End
Start = Found + 1
Next
Temp = Left(Mstr, Found)
RowNo = Len(Temp) - Len(Replace(Temp, "|", ""))
NthMatch = RowNo
End Function
Note:- The file doen't contain the same code. So Copy and paste from here.
Check the attached file:-
Bookmarks