I believe that I'm having trouble with InStr here.
I have a for loop, looping through a bunch of values, and exiting correctly when a cell contains "--".
However, if the cell contains text that cound be found in Range("A2"), then I want it to spit out it's value to Range("A5").
Private Sub CommandButton21_Click()
Dim cell As Range
For Each cell In Sheets(1).Range("$B:$B")
Dim i As Long
i = cell.Row + i
If InStr(1, cell.Text, Range("A2").Text, vbTextCompare) Then Range("A5").Value = cell.Text
If cell.Text = "--" Then Exit For
Next cell
End Sub
No idea why this sort of compare is failing.