ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loop cells - get all rows with matching data - paste into different wb (https://www.excelbanter.com/excel-programming/304829-loop-cells-get-all-rows-matching-data-paste-into-different-wb.html)

Buffyslay_co_uk

Loop cells - get all rows with matching data - paste into different wb
 
ok - i think i got most of what i am looking for in the title!!

I have a workbook, i have data in rows - (cols A:CJ)

Loop cells (col E)-

get all rows with matching data in where the first 4 characters = ("XXXX") -

paste all of these into different wb, worksheet ( "FAR" )

then again for ("YYYY") etc....

can anyone show me some quick code that i can throw in???

note: the workbook is already open, and is referenced in the code already....

(reply to

Mike Fogleman

Loop cells - get all rows with matching data - paste into different wb
 
Instead of looping through your data in column E, use AutoFilter on all the
data with the filter field as column E and the criteria as "XXXX". Then
copy/paste the filtered data to your other workbook. The looping will be
done on the filter criteria to do the above routine again with "YYYY".
Without more specifics, I can't give you code, but the Macro recorder would
give you the filtering routine code to build your loop around.
Mike F
"Buffyslay_co_uk" wrote in message
om...
ok - i think i got most of what i am looking for in the title!!

I have a workbook, i have data in rows - (cols A:CJ)

Loop cells (col E)-

get all rows with matching data in where the first 4 characters =

("XXXX") -

paste all of these into different wb, worksheet ( "FAR" )

then again for ("YYYY") etc....

can anyone show me some quick code that i can throw in???

note: the workbook is already open, and is referenced in the code

already....

(reply to




Tom Ogilvy

Loop cells - get all rows with matching data - paste into different wb
 
Or use advanced filter to copy the data with one command.

--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
news:CS6Mc.150374$JR4.27865@attbi_s54...
Instead of looping through your data in column E, use AutoFilter on all

the
data with the filter field as column E and the criteria as "XXXX". Then
copy/paste the filtered data to your other workbook. The looping will be
done on the filter criteria to do the above routine again with "YYYY".
Without more specifics, I can't give you code, but the Macro recorder

would
give you the filtering routine code to build your loop around.
Mike F
"Buffyslay_co_uk" wrote in message
om...
ok - i think i got most of what i am looking for in the title!!

I have a workbook, i have data in rows - (cols A:CJ)

Loop cells (col E)-

get all rows with matching data in where the first 4 characters =

("XXXX") -

paste all of these into different wb, worksheet ( "FAR" )

then again for ("YYYY") etc....

can anyone show me some quick code that i can throw in???

note: the workbook is already open, and is referenced in the code

already....

(reply to







All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com