title: simple vba code gives me run time error 91 object variable or with block not set
body: <p>So I have a simple little macro/sub defined when a command button is clicked. The problem is it gives me:</p>
  <blockquote>Run Time Error '91' : Object Variable or With Block not Set</blockquote>
  <p>My code is:</p>
  <pre><code>Dim rng As Range
  rng = Sheet8.Range(&quot;A12&quot;) '&lt;&lt; ERROR here
  rng.Value2 = &quot;1&quot;
  </code></pre>
  <p><strong>I just want to set Cell &quot;A12&quot; in Sheet8.</strong></p>
  <p><img src="https://i.stack.imgur.com/bV6KW.jpg" alt="enter image description here" /></p>
  <p>Thanks!</p>