Hi wonderful people. I'm hoping you may be able to help. Apologies if this has already been solved elsewhere.
I have HR data like the inout data table below where I have manager and subordinate employee numbers.
I'd like to find some VBA code to output the table to the right below. In my case of the HR hierarchy data this enables me to pick any manager and find all the subordinates to them down through the full organisational tree.
[TABLE="width: 435"]
<colgroup><col width="87" span="5" style="width: 65pt;"></colgroup><tbody>[TR]
[TD="class: xl65, width: 87"]Input Data[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"]Output Data[/TD]
[TD="width: 87"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]Parent[/TD]
[TD="class: xl66, align: center"]Child[/TD]
[TD][/TD]
[TD="class: xl66, align: center"]Parent [/TD]
[TD="class: xl66, align: center"]Children[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]B[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]B[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]C[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]D[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]D[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]E[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]E[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]D[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]G[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]D[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]E[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]D[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]D[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]G[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
</tbody>[/TABLE]
I have HR data like the inout data table below where I have manager and subordinate employee numbers.
I'd like to find some VBA code to output the table to the right below. In my case of the HR hierarchy data this enables me to pick any manager and find all the subordinates to them down through the full organisational tree.
[TABLE="width: 435"]
<colgroup><col width="87" span="5" style="width: 65pt;"></colgroup><tbody>[TR]
[TD="class: xl65, width: 87"]Input Data[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"]Output Data[/TD]
[TD="width: 87"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl66, align: center"]Parent[/TD]
[TD="class: xl66, align: center"]Child[/TD]
[TD][/TD]
[TD="class: xl66, align: center"]Parent [/TD]
[TD="class: xl66, align: center"]Children[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]B[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]B[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]C[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]D[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]D[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]E[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]E[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]D[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 87"]G[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]A[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]D[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]E[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]C[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]D[/TD]
[TD="class: xl65, width: 87"]G[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]D[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, width: 87"]G[/TD]
[TD="class: xl65, width: 87"]H[/TD]
[/TR]
</tbody>[/TABLE]