title: VBA Find problems - error when nothing found
body: <p>I bet this is something simple.  Even though I've researched a lot and tried several methods I still get run time error 424.</p>
  
  <p>The code is to find a number the user has entered. If the number is in the data set I want to do one thing but if the number is not in the data set I want to do something else.</p>
  
  <p>Code is below.</p>
  
  <pre><code>Sub Test()
  
  Dim Material As String
  Dim cell As Range
  
      Material = InputBox("Enter BIS # for material type")
  
      Range("A7:a40").Select
  
         Set cell = Selection.Find(What:=Material, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _, SearchFormat:=False).Activate
      If cell Is Nothing Then
          MsgBox "Boo"
  
      Else
          MsgBox "Great"
  
  End If
  
  End Sub
  </code></pre>