title: For-Next Loop and Arrays - VBA
body: <p>I keep making the same mistake, and I have no idea what it is.  Every time I make a For-Loop dealing with arrays (usually, trying to read one array and write the values in a second array), it just takes the very last value from the first array and writes it in every single slot of the second array.  </p>
  
  <p>Here's a copy of the easiest/shortest one I'm working on.  It's supposed to read the values out of A1:A10 and write them to B1:K1.</p>
  
  <pre><code>Sub Problem1()
      Dim a(1 To 10) As Single
      Dim b(1, 10) As Single
      Dim i As Integer
  
  
  
      For i = 1 To 10
          a(i) = Range("A" + CStr(i)).Value
      Next i
  
      For i = 1 To 10
          b(1, i) = a(i)
      Next i
  
      Range("B1:K1") = b(1, 10)
  
  End Sub
  </code></pre>