title: VBA For each loop, type mismatch
body: <p>I have an issue where I get the type mismatch error when running my code, I'm trying to store an output of a calculation into an array using the 'For each' loop to loop through the range of cells that hold the value id like to multiply by a static value and then store.</p>
  <p>How do I adjust the code to prevent the type mismatch error for the array <code>GrossHS()</code>?</p>
  <pre><code>Sub NetWeightDist()
  
  Dim mltplier As Double
  Dim SumGW As Long
  Dim GrossHS() As Variant
  Dim lngth As Long
  Dim Netrng As Range
  Dim NetCl As Range
  
  lngth = Cells(Rows.Count, 9).End(xlUp).Row
  
  SumGW = Application.WorksheetFunction.Sum(Range(&quot;L2:L1000&quot;))
  mltplier = Worksheets(&quot;Sheet1&quot;).Range(&quot;Q2&quot;).Value / SumGW
  
  Set Netrng = Worksheets(&quot;Sheet1&quot;).Range(&quot;L2:L&quot; &amp; lngth)
  
  ReDim GrossHS(1 To lngth)
  For Each NetCl In Netrng
  
  GrossHS() = mltplier * NetCl.Value
  Next
  
  End Sub
  </code></pre>