title: Excel VBA: How to solve Run-time error '91'?
body: <p>I get the error:</p>
  
  <p><code>Run-time error '91': Object variable or With block variable not set</code> </p>
  
  <p>when I try to execute this code:</p>
  
  <pre><code>MsgBox Worksheets("Sheet2").Range("2:2").Find(Worksheets("Sheet1").Range("E5").Value, , , xlWhole)
  </code></pre>
  
  <p>Why? What is wrong with this row?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The code works if I am managing text or numbers. But I have that issue what I have <strong>dates</strong> on <code>Worksheets("Sheet1").Range("E5")</code> and <code>Worksheets("Sheet2").Range("2:2")</code>.</p>