title: VBA Excel, loop through variables
body: <p>Was trying to fix below for couple of hours now and I think I'm just permanently stuck with it. To the point.</p>
  
  <p>Current code:</p>
  
  <pre><code>Sub ttttt()
  Dim i1 As Integer, i2 As Integer, i3 As Integer, i4 As Integer
  Dim vGen As Variant
  Dim vCurrent As Variant
  
  i1 = 1
  i2 = 20
  i3 = 300
  i4 = 4000
  
  vGen = Array(i1, i2, i3, i4)
  
  For Each vCurrent In vGen
      MsgBox vCurrent
  Next
  
  End Sub
  </code></pre>
  
  <p>Question 1
  I would like to be able to return variable name, in the same way as you can return type: TypeName(). So for first loop msgbox would say: i1 and so on. I was trying different combination of .name etc but seems to fail me all the time.</p>
  
  <p>Question 2
  Reason for question 1 is, as a next step I would like to add something to the original value depending on the variable name.</p>
  
  <p>Hopefully I would like to have something like this (obviously this code does not work, it's only for presentation):</p>
  
  <pre><code>For Each vCurrent In vGen
      vCurrent.name = vcurrent + iSomeNumber
  Next
  </code></pre>
  
  <p>Where iSomeNumber will be coming in from another part of the program and then i could retrieve updated individual variables later on (i.e. i1 will no longer be value 1 but 1 + iSomeNumber).</p>
  
  <p>Hopefully I've explained my problem plainly, if you would require any additional info please let me know.</p>
  
  <p>Also I will be AFK for another 4 hours, so my reply might be a little bit delay.</p>
  
  <p>Thank you in advance for any help!</p>