View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Wildcard operators to use with LIKE

Hi,

Try this alternative to like

If InStr(cell2srch, "traf10") And Not InStr(cell2srch, "traf106") Then
Cells(cell2srch.Row, 1).Value = "Yes"

Mike

"LuisE" wrote:

Im using LIKE to determine if a cell contains certain text, but I dont know
how to use the wildcard characters or how to structure a pattern to make the
search effective.
I want to find any cell with the text €śtraf10€ť in it not necessarily being
that string the only content of the cell.

If Cell2Srch.Value Like "traf10" And Not Cell2Srch.Value Like "traf106" Then
Cells(Cell2Srch.Row, 1).Value = "Yes"
End If

Thanks in advance