title: VBA Tree/Hierarchy
body: <p>I am attempting to use Excel to fill in the blank cells in an organisational hierarchy I have. Before and After scenarios below.</p>
  
  <p>I have attempted pseudocode on this.</p>
  
  <p><img src="https://i.imgur.com/spw6WDK.png" alt="before"></p>
  
  <p><img src="https://i.imgur.com/HbQy8xO.png" alt="After"></p>
  
  <pre><code>For all rows
  For all cells in row
  If cell is populated, row++
  If cell is not populated, copy the value immediately above to the current cell and check next cell in row.
  </code></pre>
  
  <ol>
  <li>Is this logic sound? </li>
  <li>How would I go about implementing this in VBA?</li>
  </ol>
  
  <p>Im guessing I can iterate through each cell in each row like this...</p>
  
  <pre><code>For Each row In rng.Rows
  For Each cell in row.Cells
  'Do Something
  Next cell
  Next row
  </code></pre>
  
  <p>but then I get stuck! Any help would be greatly appreciated.</p>