title: Parent child relationship in vba excel
body: <p>I want to write a code where i have following data  </p>
  
  <pre><code>0   a  
  1   b  
  1   c  
  2   d  
  2   e  
  2   f  
  3   g  
  3   h  
  3   i  
  2   j  
  3   k  
  0   l  
  1   m  
  </code></pre>
  
  <p>Numbers in the first column is parent ID. So, 'a' is the parent of 'b'&amp; 'c'. Similarly c is the parent of 'd', 'e', 'f'.<br>
  'l'  is the parent of 'm'.   </p>
  
  <p>I want output in the below format.  </p>
  
  <pre><code>Parent Child   
  a   b  
  a   c    
  c   d    
  c   e    
  c   f  
  f   g  
  f   h  
  f   i  
  c   j  
  j   k  
  l   m  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/qfIYI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qfIYI.png" alt="input output picture"></a>
  I need to write this in VBA.<br>
  Can someone please guide. </p>