Marco to Filter and Copy Multiple Rows

THRASHER69

Board Regular
Joined
Mar 29, 2012
Messages
200
Hello. I'm needing a macro to filter by a word in column A and then copy several rows to a new sheet. The amount of rows to copy could be different every time depending on the data in the other columns. In the example spreadsheet screenshot below, I want to filter by column A with the word BSHIP. When it finds the word BSHIP, I need it to copy rows 7:15, Rows 22:24, and rows 25:27 to a new sheet. I need the row before for the header. So basically, I need it to start coping at the word Planner and down to the last row before it says Planner again based on the word BSHIP (or TCOILE,MFJAMESON, ect...). I will set it up to filter each name into it's own sheet. I'm just having trouble figuring out how to get it to copy all the rows in between. Thanks in advance.

THRASHER

Orderless Original

*ABCD
PlannerAMProduct numberName
BHWHWA24.5"MALE BODY - LM55
***4.5"MALE BODY - LM55
PlannerAMProduct numberName
TCOILEA2BOP HANDLE *(PATT #533)
***BOP HANDLE *(PATT #533)
PlannerAMProduct numberName
BSHIP*11601010X1.12"SET-COMP"C-X"CONE PKG (5)
***1.12"SET-COMP"C-X"CONE PKG (5)
***1.12"SET-COMP"C-X"CONE PKG (5)
***1.12"SET-COMP"C-X"CONE PKG (5)
BSHIP*11601010X1.12"SET-COMP"C-X"CONE PKG (5)
***1.12"SET-COMP"C-X"CONE PKG (5)
***1.12"SET-COMP"C-X"CONE PKG (5)
***1.12"SET-COMP"C-X"CONE PKG (5)
MFJAMESON*11901061NP1.75"LUB BODY W/ZERK NOT PAINTED
***1.75"LUB BODY W/ZERK NOT PAINTED
TCOILE*1.37-1.5"LUB BODY W/ZERK
***1.37-1.5"LUB BODY W/ZERK
PlannerAMProduct numberName
BSHIPA112902010NCPACKING CAP F/2"BPR (NACE)
***PACKING CAP F/2"BPR (NACE)
BSHIP*12902010NCPACKING CAP F/2"BPR (NACE)
***PACKING CAP F/2"BPR (NACE)
PlannerAMProduct numberName
BSHIP*1.25" FIGURE 1 HINGE CLAMP
***1.25" FIGURE 1 HINGE CLAMP
***1.25" FIGURE 1 HINGE CLAMP
***1.25" FIGURE 1 HINGE CLAMP
***1.25" FIGURE 1 HINGE CLAMP
***1.25" FIGURE 1 HINGE CLAMP
***1.25" FIGURE 1 HINGE CLAMP

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:89px;"><col style="width:27px;"><col style="width:100px;"><col style="width:459px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]

[TD="align: right"]10901821[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]

[TD="align: right"]10908160[/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]

[TD="bgcolor: #cacaca, align: center"]9[/TD]

[TD="bgcolor: #cacaca, align: center"]10[/TD]

[TD="bgcolor: #cacaca, align: center"]11[/TD]

[TD="bgcolor: #cacaca, align: center"]12[/TD]

[TD="bgcolor: #cacaca, align: center"]13[/TD]

[TD="bgcolor: #cacaca, align: center"]14[/TD]

[TD="bgcolor: #cacaca, align: center"]15[/TD]

[TD="bgcolor: #cacaca, align: center"]16[/TD]

[TD="bgcolor: #cacaca, align: center"]17[/TD]

[TD="bgcolor: #cacaca, align: center"]18[/TD]

[TD="align: right"]11901021[/TD]

[TD="bgcolor: #cacaca, align: center"]19[/TD]

[TD="bgcolor: #cacaca, align: center"]20[/TD]

[TD="bgcolor: #cacaca, align: center"]21[/TD]

[TD="bgcolor: #cacaca, align: center"]22[/TD]

[TD="bgcolor: #cacaca, align: center"]23[/TD]

[TD="bgcolor: #cacaca, align: center"]24[/TD]

[TD="bgcolor: #cacaca, align: center"]25[/TD]

[TD="bgcolor: #cacaca, align: center"]26[/TD]

[TD="align: right"]21201002[/TD]

[TD="bgcolor: #cacaca, align: center"]27[/TD]

[TD="bgcolor: #cacaca, align: center"]28[/TD]

[TD="bgcolor: #cacaca, align: center"]29[/TD]

[TD="bgcolor: #cacaca, align: center"]30[/TD]

[TD="bgcolor: #cacaca, align: center"]31[/TD]

[TD="bgcolor: #cacaca, align: center"]32[/TD]

</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,224,604
Messages
6,179,857
Members
452,948
Latest member
UsmanAli786

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
Back
Top