title: Multiplying arrays with scalars and adding in VBA
body: <p>I have two columns of data in an excel sheet that are equal in size and both only contain numbers.  </p>
  
  <p>I'm trying to write a macros which will put both of these sets  into arrays, then perform a calculation on them. Specifically <code>ArrayA + 3*ArrayB</code> then put the result back into the worksheet in a new column.  Below is the code I have so far.  </p>
  
  <pre><code>Dim ArrayA As Variant
  Dim ArrayB As Variant
  Dim ArrayC As Variant
  
  ArrayA = Worksheets("Sheet1").Range("A1:A5")
  ArrayB = Worksheets("Sheet1").Range("B1:B5")
  
  'this is where things go bad
  ArrayC = ArrayA + 3 * ArrayB
  </code></pre>