title: Run-time Error 91 - Object Variable or with Block variable not set - VBA
body: <p>I have the following snippet VBA: </p>
  
  <pre><code>DatetoRun = InputBox("How far back do you want to run the MI for?", "Date backing", Format(Now(), "dd/mm/yyyy"))
  
  'Date validation for DatetoRun
  If IsDate(DatetoRun) Then       
      DatetoRun = Format(CDate(DatetoRun), "dd/mm/yyyy")
      dateStart = DatetoRun        
  Else
      MsgBox "Please enter a DATE in the correct format dd/mm/yyyy"
  End If
  
  Set found = Range("A:A").Find(what:=DatetoRun, LookIn:=xlValues, lookat:=xlWhole)
  
  iclearrow = found.Row
  </code></pre>
  
  <p>When executing it I keep getting the </p>
  
  <blockquote>
    <p>Object Variable or With Block variable not set</p>
  </blockquote>
  
  <p>which confuses me as I am setting it:</p>
  
  <pre><code>Set found = Range("A:A").Find(what:=DatetoRun, LookIn:=xlValues, lookat:=xlWhole)
  </code></pre>
  
  <p>The error happens on the last row:</p>
  
  <pre><code>iclearrow = found.Row
  </code></pre>
  
  <p>Not sure how or why this is happening. also sometime it will randomly work once, but then error out after. Nothing is consistent!</p>