Store Cell Value In Variable
<p>I am trying to store the value of a cell in a variable using vba.  My code throws an error, what should I change so that the value of the cell is stored in my variable?</p>

<pre><code>Dim total As Long
total = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).End.Value
Debug.Print (total)
</code></pre>

<p>The error I get is </p>

<blockquote>
  <p>Wrong number of arguments or invalid property assigned</p>
</blockquote>