ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get rows which match selection criteria (https://www.excelbanter.com/excel-programming/292106-get-rows-match-selection-criteria.html)

Fred Smith

Get rows which match selection criteria
 
I have an external file with about 20,000 rows in it. Each row has 6
columns. I need to work with all the rows where Column C = 'Name'. There
will be a maximum of 25 rows.

If I were doing it manually, I'd turn on Autofilter, select my Name in
Column C then copy the visible rows.

What's the most efficient way to do this in a macro? Is it best to copy the
cells into an array? If so, how?

Thanks,
Fred
Please reply to newsgroup, not e-mail




Tom Ogilvy

Get rows which match selection criteria
 
What is the format of the external file - csv, fixed width, a database file?

Can you open it in excel and it separates into appropriate columns?

If so, one obvious choice is to open it in excel, apply the autofilter and
get you data. (using a macro of course).

--
Regards,
Tom Ogilvy

"Fred Smith" wrote in message
...
I have an external file with about 20,000 rows in it. Each row has 6
columns. I need to work with all the rows where Column C = 'Name'. There
will be a maximum of 25 rows.

If I were doing it manually, I'd turn on Autofilter, select my Name in
Column C then copy the visible rows.

What's the most efficient way to do this in a macro? Is it best to copy

the
cells into an array? If so, how?

Thanks,
Fred
Please reply to newsgroup, not e-mail







All times are GMT +1. The time now is 03:33 PM.

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