title: How to use Poiters (References) in a VBA For Each Loop?
body: <p>When I run the following code the source <code>etapasArray</code> doesn't have their own values changed!</p>
  
  <p>The array <code>etapasArray</code> has each element accessed as <code>etapasArray(i)(j)</code>.</p>
  
  <p>This is the sub function:</p>
  
  <pre class="lang-vb prettyprint-override"><code>'etapasArray is accessed as etapasArray(i)(j) and etapaRow was declared as Variant
  Public Sub setDatasPLANO()
      For Each etapaRow In etapasArray
          If etapaRow(oFolhaPlaneamento.positionElement("PERCENTAGEM")) &lt; 1 Then
              etapaRow(oFolhaPlaneamento.positionElement("PLANO_INICIO")) = 1
          End If
      Next
  End Sub
  </code></pre>
  
  <p>It reads correctly the existing values but the final <code>etapasArray</code> never gets the number 1 in it! Any ideas?</p>