title: Assigning Values to an Array in a loop
body: <p>I Just started working on VBA excel. I want to assign certain values to an array but </p>
  
  <p>I got </p>
  
  <blockquote>
    <p>Run time error '9'</p>
  </blockquote>
  
  <pre><code>Sub Getvalues()
  Dim i As Long
  Dim Arry() As Long
  
  For i = 1 To Rows.Count
  If Cells(i, 3).Value &lt;= 1 And Not IsEmpty(Cells(i, 3).Value) Then
      Arry(i - 1) = Cells(i, 1)
  End If
  Next i
  
  End Sub
  </code></pre>