Copy Multiple columns based on search criteria to another worksheet

Alteridem

New Member
Joined
Sep 27, 2011
Messages
2
Hi Everyone I'm new here, and excited to join the community thanks! I need some help on a VBscript / Macro I was trying to make.

Rep Name is Column J Row 5. I need to find multiple columns based by the header which is row 5, if column range (j5:az5) is “Video – Actual” then copy column to sheet “Data”, this needs to be repeated for about 8 more times for different criteria, can you guys help please. J
<TABLE style="MARGIN: auto 0.1in; WIDTH: 356pt; BORDER-COLLAPSE: collapse; mso-table-lspace: 9.0pt; mso-table-rspace: 9.0pt; mso-table-anchor-vertical: page; mso-table-anchor-horizontal: margin; mso-table-left: left; mso-table-top: 135.05pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class=MsoNormalTable border=0 cellSpacing=0 cellPadding=0 width=593 align=left><TBODY><TR style="HEIGHT: 63pt; mso-yfti-irow: 0"><TD style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: silver; HEIGHT: 63pt; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" width=240>
Rep Name<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
</TD><TD style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: silver; HEIGHT: 63pt; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" width=97>
Bundle - Target<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: silver; HEIGHT: 63pt; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" width=90>
Bundle - Actual<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: silver; HEIGHT: 63pt; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" width=83>
Video - Target<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: silver; HEIGHT: 63pt; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" width=83>
Video - Actual<o:p></o:p>
</TD></TR><TR style="HEIGHT: 13.2pt; mso-yfti-irow: 1"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=240 noWrap>Joe, Jane<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=97 noWrap x:num>
2.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=90 noWrap x:num>
6.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
6.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
4.0<o:p></o:p>
</TD></TR><TR style="HEIGHT: 13.2pt; mso-yfti-irow: 2"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=240 noWrap>Smith, John<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=97 noWrap x:num>
7.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=90 noWrap x:num>
10.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
2.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
6.0<o:p></o:p>
</TD></TR><TR style="HEIGHT: 13.2pt; mso-yfti-irow: 3"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=240 noWrap>Tucker, Chris<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=97 noWrap x:num>
19.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=90 noWrap x:num>
39.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
5.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
17.0<o:p></o:p>
</TD></TR><TR style="HEIGHT: 13.2pt; mso-yfti-irow: 4"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=240 noWrap>Sandler, Adam<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=97 noWrap x:num>
15.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=90 noWrap x:num>
11.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
6.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
10.0<o:p></o:p>
</TD></TR><TR style="HEIGHT: 13.2pt; mso-yfti-irow: 5"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=240 noWrap>Iglesias, Gabriel<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=97 noWrap x:num>
8.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=90 noWrap x:num>
3.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
6.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
10.5<o:p></o:p>
</TD></TR><TR style="HEIGHT: 13.2pt; mso-yfti-irow: 6"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=240 noWrap>Smith, Will<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=97 noWrap x:num>
8.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=90 noWrap x:num>
3.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
6.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
6.5<o:p></o:p>
</TD></TR><TR style="HEIGHT: 13.2pt; mso-yfti-irow: 7; mso-yfti-lastrow: yes"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 2in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=240 noWrap>Powers, Austin<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 58pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=97 noWrap x:num>
10.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 0.75in; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=90 noWrap x:num>
25.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
7.0<o:p></o:p>
</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 50pt; PADDING-RIGHT: 5.4pt; BACKGROUND: white; HEIGHT: 13.2pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=83 noWrap x:num>
9.0<o:p></o:p>
</TD></TR></TBODY></TABLE>
<o:p> </o:p>
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Watch MrExcel Video

Forum statistics

Threads
1,129,373
Messages
5,635,884
Members
416,886
Latest member
coreyalaurence37

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top