title: Creating an array from a range of cells in Excel VBA
body: <p>The following is pretty much identical to the solutions online that I've found:</p>
  <pre><code>
  Dim iAmount() As Variant
  Dim INum As Integer
  
  iAmount = Range(&quot;C23:W23&quot;)
  'The example uses iAmount = Range(&quot;A1:A11&quot;)
  
  For iNum = 1 to Ubound(iAmount)
  Debug.Print iAmount(iNum,1)
  Next iNum
  
  End Sub
  </code></pre>
  <p>However when I try to work with this array I get error 9 which I interpret to mean that I referenced a variable that doesn't exist.</p>