title: Create an array based on a range object
body: <p>I was wondering whether it is possible to load an Excel range object into an array. Suppose we have an Excel sheet with the following values in A5 to A7, 1 to 3 (i.e. one in A5, 2 in A7 and 3 in A7). I use the following code:</p>
  
  <pre><code>Public Sub Test()
      Dim Test As Range
      Set Test = Worksheets("Sheet1").Range("A5:A7")
  
      Dim arrayMe As Variant
      arrayMe = Test
  
      Dim i As Integer
      For i = 1 To 3
          MsgBox (arrayMe(i))
      Next i
  End Sub
  </code></pre>
  
  <p>If I run the code, I will get index out of bound exception. More specifically,
  Run-time error '9': Subscript out of range. Can someone explain to me what is wrong with this code?</p>
  
  <p>Thanks</p>