Hello everyone,
Here is what I am trying to do : My userform called selectTr has a listbox in which the user choses one value. I want to check whether I have this value in the third column of my sheet or not and act accordingly so here is my code :
I read online that Application.Match supposedly returns #N/A if the value is not found which is why I have this If Not isError(coordInsert).
But the problem is that when the value is not found by the match function, it throws an error message box of type incompatibility.
(Everything works fine when the value is in the column.)
Any idea guys ?
Thank you for reading,
Marie
Here is what I am trying to do : My userform called selectTr has a listbox in which the user choses one value. I want to check whether I have this value in the third column of my sheet or not and act accordingly so here is my code :
Code:
Dim found As Integer
found[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]= Application.Match(Left(selectTr.listTr.Value, 3), Range(Cells(1, 3), Cells(lgnCount, 3)), 0)
If Not IsError(coordInsert) Then
MsgBox "Found at lign " & coordInsert
...I do things........
Else
MsgBox "Not found"
... I do something else..........
End If[/FONT]
I read online that Application.Match supposedly returns #N/A if the value is not found which is why I have this If Not isError(coordInsert).
But the problem is that when the value is not found by the match function, it throws an error message box of type incompatibility.
(Everything works fine when the value is in the column.)
Any idea guys ?
Thank you for reading,
Marie