title: Excel VBA variable use: Is it better to use multiple variables or one array to store information
body: <p>I've been using VBA for about a month now, and this forum has been a great resource for my first "programming" language. As I've started to get more comfortable with VBA arrays, I've begun to wonder what the best way to store variables is, and I'm sure someone here knows the answer to what's probably a programming newb question:</p>
  
  <p>Is there any difference, say, between having 10 <code>String</code> variables used independently of each other or an array of <code>String</code> variables used independently of each other (by independent I mean their position in the array doesn't matter for their use in the program). There are bits of code I use where I might have around 9 public variables. Is there any advantage to setting them as an array, despite the fact that I don't need to preserve their order <em>vis a vis</em> one another? e.g. I could have</p>
  
  <pre><code>Public x As String
  Public y As String
  Public v As String
  Public w As String
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>Public arr(1 to 4) As String
  arr(1) = x
  arr(2) = y
  arr(3) = v
  arr(4) = w
  </code></pre>
  
  <p>In terms of what I need to do with the code, these two versions are functionally equivalent. But is there a reason to use one rather than the other?</p>
  
  <p>Connected to this, I can transpose an array into an Excel field, and use <code>xlUp</code> and <code>xlDown</code> to move around the various values in the array. But I can also move through arrays in similar ways by looking for elements with a particular value or position in an array held "abstractly."* Sometimes I find it easier to manipulate array values once they have been transposed into a worksheet, using <code>xlUp</code> and <code>xlDown</code>. Apart from having to have dedicated worksheet space to do this, is this worse (time, processing power, reliability etc.) than looping through an "abstract"* array (if <code>Applications.ScreenUpdating = False</code>)?</p>
  
  <p>*This may mean something technical to mathematicians/ serious programmers - I'm trying to say an array that doesn't use the visual display of the worksheet grid.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Thank you for your interesting answers. I'm not sure if the second part of my question counts as a second question entirely and I'm therefore breaking a rule of the forum, or if it is connected, but I would be very happy to tick the answer that also considered it</p>