title: How to insert a new value at certain index in an array and shift everything down by one index?
body: <p>let's say if I have this array in vba</p>
  
  <pre><code>a(0) = 1
  a(1) = f
  a(2) = g
  a(3) = 4
  .
  ..
  ..
  a(k) = a
  </code></pre>
  
  <p>and I want to insert a new value at (0) and shift every value down by one index like this</p>
  
  <pre><code>a(0) = newVal
  a(1) = 1
  a(2) = f
  a(3) = g
  a(4) = 4
  .
  ..
  ..
  a(k+1) = a
  </code></pre>
  
  <p>is there a short hand code to do this if not what's the fastest way to do this?</p>
  
  <p>I can do this with simple for loop but I was wondering if there is more efficient way?</p>
  
  <p>Example this is what I can come up with</p>
  
  <pre><code>Dim temp()
  
  Redim Preserve temp(0)
  temp(0) = "newVal"
  
  For i= lbound(a) + 1 to ubound(a) + 1
       redim preserve temp(i)
       temp(i) = a(i-1)
  Next i
  </code></pre>