title: Dynamically Create Dynamic Arrays in VBA
body: <p>My objective is to use an array of names to create dynamic variables in VBA, heres the code:</p>
  
  <pre><code>Sub mymacro()
  Dim names()
  names = Array("cat_code()", "dog_code()", "eagle_code()")
  For Each c In names
  Dim c As Integer
  Next
  end sub
  </code></pre>
  
  <p>And of course my real name array has hundreds of animals so it would be rather boring doing <code>Dim</code> for each and every one of them. The error I'm getting is <code>Compile Error: Duplicate declaration in current scope</code></p>
  
  <p>What is the best feasible solution to my objective?</p>