VBA Append data based on headers

Copper Contributor

good day,

 

can anyone help me with this?

 

I want to append data based on headers not with cell address or column number.

Please see the example below.

 

I want to run this through macro as well. Can anyone give me a script? Please.

 

thank you!

 

 

 

source file

doc numDependent Name LastDependent Name Firstdoc numDependent Name LastDependent Name Firstdoc numDependent Name LastDependent Name First
1ads1231  1asd23112315sfasd
2  2asdasd2312  
3qwe231121fsd3aa231awd1eqw1313ascas1231dsxcqweqdw2
4  4  4123dqwdasasca212e1
5qwe12dasd212312dasd25  5  

 

 

desired result

doc numDependent Name LastDependent Name First
1ads123
2  
3qwe231121fsd
4  
5qwe12dasd212312dasd2
1  
2asdasd231
3aa231awd1eqw131
4  
5  
1asd23112315sfasd
2  
3ascas1231dsxcqweqdw2
4123dqwdasasca212e1
5  

 

0 Replies