title: vb.net .Find exact match
body: <p>Hello I am trying to find the exact match of a string in excel and not a part of it the cell has to equal the exact string and not just part of it here is what I got.</p>
  
  <pre><code>Private Sub txtSMaterial_Leave(sender As Object, e As EventArgs) Handles txtSMaterial.Leave
      strEX = txtSMaterial.Text.ToString()
     Found = oSheetExtrusions.Range("A6:A5000").Find(What:=strEX, _
                                                          LookIn:=Excel.XlFindLookIn.xlValues, _
                                                          LookAt:=Excel.XlLookAt.xlWhole, _
                                                          SearchOrder:=Excel.XlSearchOrder.xlByRows, _
                                                          SearchDirection:=Excel.XlSearchDirection.xlNext)
  
      If Found Is Nothing Then
          txtSLength.Text = "N/A"
          Exit Sub
      Else
  
      End If
  
      txtSLength.Text = strExLength
  
  End Sub
  </code></pre>