I'm trying to create a second table from an original table based off of non zero values indicated in the third column of the original table. I need to do this using vba / macro, here is a visual of what I need to do.
the range of the table is cells G10 to I47, this is just a snippet. I was thinking of looping through the range and if last column value isn't zero copy to new range. But not sure how to do it... Thank you!
[TABLE="width: 500"]
<tbody>[TR]
[TD]Comp[/TD]
[TD]ID[/TD]
[TD]Wt%[/TD]
[TD][/TD]
[TD]Comp[/TD]
[TD]ID[/TD]
[TD]wt%[/TD]
[/TR]
[TR]
[TD]x1[/TD]
[TD]aa[/TD]
[TD]0[/TD]
[TD][/TD]
[TD]x2[/TD]
[TD]bb[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]x2[/TD]
[TD]bb[/TD]
[TD]2[/TD]
[TD][/TD]
[TD]x5[/TD]
[TD]ee[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]x3[/TD]
[TD]cc[/TD]
[TD]0[/TD]
[TD][/TD]
[TD]x6[/TD]
[TD]ff[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]x4[/TD]
[TD]dd[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]x5[/TD]
[TD]ee[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]x6[/TD]
[TD]ff[/TD]
[TD]4[/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]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/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]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/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]
[/TR]
</tbody>[/TABLE]
the range of the table is cells G10 to I47, this is just a snippet. I was thinking of looping through the range and if last column value isn't zero copy to new range. But not sure how to do it... Thank you!
[TABLE="width: 500"]
<tbody>[TR]
[TD]Comp[/TD]
[TD]ID[/TD]
[TD]Wt%[/TD]
[TD][/TD]
[TD]Comp[/TD]
[TD]ID[/TD]
[TD]wt%[/TD]
[/TR]
[TR]
[TD]x1[/TD]
[TD]aa[/TD]
[TD]0[/TD]
[TD][/TD]
[TD]x2[/TD]
[TD]bb[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]x2[/TD]
[TD]bb[/TD]
[TD]2[/TD]
[TD][/TD]
[TD]x5[/TD]
[TD]ee[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]x3[/TD]
[TD]cc[/TD]
[TD]0[/TD]
[TD][/TD]
[TD]x6[/TD]
[TD]ff[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]x4[/TD]
[TD]dd[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]x5[/TD]
[TD]ee[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]x6[/TD]
[TD]ff[/TD]
[TD]4[/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]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/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]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/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]
[/TR]
</tbody>[/TABLE]