title: Using an input box and msg box to search for data in excel VBA
body: <p>I'm working on a sub that requires me to make it so that a user can search for their ProductID with an input box and then let them know with a msgbox whether it was or was not found, but I can't get the code right. What am I doing wrong here? Totally lost (code below):</p>
  <pre><code>Sub test()
  
      Dim Worksheet As Range
      Dim ProductID As Variant
  
      ProductID = InputBox(&quot;Please enter the Product ID&quot;)
  
      With Worksheets(1).Range(&quot;A1:Z1000&quot;)
          Set ProductID = .Find(&quot;ProductID&quot;, LookIn:=xlWhole)
  
          If found Then
              MsgBox ProductID(&quot;was Found&quot;)
          Else
              MsgBox ProductID &amp; (&quot; was NOT Found&quot;)
          End If
  
      End With
  End Sub
  </code></pre>