title: Type mismatch error when adding decimals to a variable "vSum"
body: <pre><code>Sub Calc()
  
  Dim vSum As Single
  Dim lRow As Integer
  
  lRow = Sheet1.Range(&quot;C&quot; &amp; Rows.Count).End(xlUp).Row
  
  vSum = 0: c = 0
  Range(&quot;Z2&quot;).EntireColumn.ClearContents
  
  For j = 2 To lRow Step 10
      If Cells(j, 3).Value &lt;&gt; 0 Then
          vSum = vSum + Cells(j, 3)
              c = c + 1
          Range(&quot;Z&quot; &amp; c + 1).Value = Cells(j, 3)
      End If
  Next j
  
  Range(&quot;AB2&quot;).Value = Format(vSum / c, &quot;00.00&quot;)
  Range(&quot;AB5&quot;).Value = c
  
  Call StDev
  
  End Sub
  </code></pre>
  <p>The purpose is to find the average.  I know there is an easier way but I want to understand the error.</p>