Keep the matched data in listbox

Hi,

I’m trying to keep the listbox rows only with the partially matched from the text in Textfield data whenever user writes any string there.
Finally, the features gives user a chance to check the target data he is looking for. Assuming that he doesn’t know the exact spell of the data.
In TextChange event of the Textfiled, I coded like below. But, it doesn’t work.

Can you let me know what is wrong, or give me the best practice to accomplish that?

  
  Dim checkString As String = Me.text
  
  For i as integer = CompObjList.ListCount - 1 downto 0
    
    If Instr(checkString,CompObjList.Cell(i,2)) < 1 Then
      
      CompObjList.RemoveRow(i)
      
    End If
    
    
  Next
  
  

for the moment what I notice is:

InStr([start,] source, find)

it accepts first the string to search in and then the string to search for,
then, to check if checkString is contained in the cell list text you must invert them

A little bit confused.
Do you mean the code ‘instr’ statement is wrong?
Can you explain it more?

InStr([start,] source, find)

I think then it should look like this

If Instr(CompObjList.Cell(i,2), checkString) < 1 Then

Oh. my bad.
It is a very basic syntax.

It works well now.

Thanks a lot.