Some additional notes and extended explanations in support of answer to this Thread
https://eileenslounge.com/viewtopic....fc302dc186f01b
The OP has this
_____ Workbook: SampleSept2020.xlsm ( Using Excel 2007 32 bit )
Worksheet: Source
Row\Col A B C D E F G 1 Header1 Header2 Header3 Header4 Header5 Header6 Header7 2 101 H2_1 H3_1 H4_1 H5_1 H6_1 H7_1 3 102 H2_2 H3_2 H4_2 H5_2 H6_2 H7_2 4 103 H2_3 H3_3 H4_3 H5_3 H6_3 H7_3 5 102 H2_4 H3_4 H4_4 H5_4 H6_4 H7_4 6 101 H2_5 H3_5 H4_5 H5_5 H6_5 H7_5 7 103 H2_6 H3_6 H4_6 H5_6 H6_6 H7_6 8 105 H2_7 H3_7 H4_7 H5_7 H6_7 H7_7 9 104 H2_8 H3_8 H4_8 H5_8 H6_8 H7_8
This what the OP wants
_____ Workbook: SampleSept2020.xlsm ( Using Excel 2007 32 bit )
Worksheet: Target
Row\Col C D E F 2 MyTarget Header3 Header4 Header7 3 101 H3_1 H4_1 H7_1 4 101 H3_5 H4_5 H7_5 5 101 6 102 H3_2 H4_2 H7_2 7 103 H3_3 H4_3 H7_3 8 103 H3_6 H4_6 H7_6 9 104 H3_8 H4_8 H7_8 10 108 11 105 H3_7 H4_7 H7_7
Here again what the OP wants, with explanations:
Expected Result MyTarget Header3 Header4 Header7 101 H3_1 H4_1 H7_1 first instance 101 H3_5 H4_5 H7_5 second instance 101 third instance (there is no third instance so left empty) 102 H3_2 H4_2 H7_2 103 H3_3 H4_3 H7_3 103 H3_6 H4_6 H7_6 104 H3_8 H4_8 H7_8 108 left empty as there is no 108 in Source 105 H3_7 H4_7 H7_7
You can see that it comes from the source worksheet:
Header1 Header2 Header3 Header4 Header5 Header6 Header7 101 H2_1 H3_1 H4_1 H5_1 H6_1 H7_1 102 H2_2 H3_2 H4_2 H5_2 H6_2 H7_2 103 H2_3 H3_3 H4_3 H5_3 H6_3 H7_3 102 H2_4 H3_4 H4_4 H5_4 H6_4 H7_4 101 H2_5 H3_5 H4_5 H5_5 H6_5 H7_5 103 H2_6 H3_6 H4_6 H5_6 H6_6 H7_6 105 H2_7 H3_7 H4_7 H5_7 H6_7 H7_7 104 H2_8 H3_8 H4_8 H5_8 H6_8 H7_8
Rem 1
The main start point on my logic is obtaining ( in a dynamic way ) a range ( in an array , arrSrch() , ) that looks like this
Header1 Header3 Header4 Header7 101 H3_1 H4_1 H7_1 102 H3_2 H4_2 H7_2 103 H3_3 H4_3 H7_3 102 H3_4 H4_4 H7_4 101 H3_5 H4_5 H7_5 103 H3_6 H4_6 H7_6 105 H3_7 H4_7 H7_7 104 H3_8 H4_8 H7_8
Note: The array arrSrch() has an extra empty row
https://imgur.com/fKjli8W
What we do with that is the subject of Rem 2 , and is explained in the next post
Bookmarks