I tried to run this in a macro but somehow the loop didn’t work as it kept referencing the cells when I need this to just run down until it hits the end. I am looking to do the following:
If there is a value in column D and nothing in column B then the information need to be copied down. To copy it will look for column A to match but look for the top line of the match (in this case row 1 and 7) so there is values in column B. once it find the top row the code should copy down rows B,E & H
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]AAA[/TD]
[TD]Spon[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[TD]Info[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD]Spon[/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD][/TD]
[TD]Yes[/TD]
[TD]Info[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD]Spon[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[TD]Info[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD]Spon[/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD][/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Can someone help! Thanks!
If there is a value in column D and nothing in column B then the information need to be copied down. To copy it will look for column A to match but look for the top line of the match (in this case row 1 and 7) so there is values in column B. once it find the top row the code should copy down rows B,E & H
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]AAA[/TD]
[TD]Spon[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD]Yes[/TD]
[TD]Yes[/TD]
[TD]Info[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD]Spon[/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD][/TD]
[TD]Yes[/TD]
[TD]Info[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD]Spon[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD]Yes[/TD]
[TD]Info[/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD]Spon[/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD]Unknown[/TD]
[TD]Info[/TD]
[TD][/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BBB[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-01-18[/TD]
[TD][/TD]
[TD]Info[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Can someone help! Thanks!