title: create array from range values VBA
body: <p>i'm trying to do a macro where i will need an array of values.
  this array is created from a range which will be variable in size.
  i've tried the below but keep having an error:</p>
  
  <pre><code>Sub chase()
  
  
  Dim rng As Range
  Dim myarray() As Variant
  
  last = Range("r1").End(xlDown).Address
  MsgBox last
  
  myarray = Range("r1:" &amp; last).Value
  For i = LBound(myarray) To UBound(myarray)
          msg = msg &amp; myarray(i) &amp; vbNewLine
      Next i
  MsgBox "the values of my dynamic array are: " &amp; vbNewLine &amp; msg
  
  
  End Sub
  </code></pre>
  
  <p>any idea how to process?</p>
  
  <p>thanks</p>