ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   opening a text file (https://www.excelbanter.com/excel-programming/303495-opening-text-file.html)

BigD[_2_]

opening a text file
 
Hi everybody.

I made a macro that opens a delimited text file. It works
fine but sometimes I only need certain rows of data
instead of the whole file. For instance I only need the
rows in which the value in the first column is "A". Is it
possible to set this kind of criteria?

Thanks.

DK

Don Guillett[_4_]

opening a text file
 
Best to copy\paste your macro here for comments.

--
Don Guillett
SalesAid Software

"BigD" wrote in message
...
Hi everybody.

I made a macro that opens a delimited text file. It works
fine but sometimes I only need certain rows of data
instead of the whole file. For instance I only need the
rows in which the value in the first column is "A". Is it
possible to set this kind of criteria?

Thanks.

DK




MSP77079[_37_]

opening a text file
 
Of course this is possible. The way I would implement it would be usin
Data/Autofilter.

I assume that you used the macro recorder to create the macro you no
have for importing the text file.

Do the same thing. Turn on the macro recorder, import the text file.
With the macro recorder still on, select the header in the column yo
want to do the selection with. Hold down the Ctrl key and press th
down arrow. From the menu, select Data Filter AutoFilter. Clic
on the arrow next to the header. Select the criterion you want (th
letter "A"). Hit the F5 key (go to). Click on the Special button.
Click the radio button next to Current Region, then click OK. Copy th
selected range. Go to another sheet and paste. Go back to th
original sheet and, from the menu, select Data Filter AutoFilte
again to turn off the AutoFilter.

Turn off the macro recorder

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:59 PM.

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