Copy Two Columns of Flat File to Final Excel File

N

Neon520

SUMMARIZED QUESTIONS
How to copy a specified/certain columns of a flat file (.csv) to a Final
Workbook without having to copy all data in the flat file at once?

DETAILED:
What I essentially need to accomplish is to copy a few columns of a flat
file (Report.csv) to a “Final fileâ€, I don’t need all of the data in the flat
file. I don’t think there is a “direct way†to get this done, so here’s what
I’m thinking of doing it:

There are three files involve in this. One is the .csv file that need to be
imported to a Temp file, and the third file is the Final file that I need to
copy only 2-3 columns the Temp file to it.

Obviously, I don’t want to save the Temp file since it would be too much to
keep track of once there are too many files in the process. Since that’s the
case, here is how I create my Macro: I open a new book (Workbook#) then run
the Transfer Data wizard to get the .csv file to that workbook. The problem
is Workbook# always change according to how many workbook the user open
previously to run this Macro, so the code: “Windows("Workbook2").Activateâ€
doesn’t work if workbook name is “Workbook[other number]. Any solution to
this?

With the understanding that dataset can change from time to time, can anyone
help me modify the code so that it will look for the last row to copy all
data instead of the set range that I gave it when I record the Macro?

Note that this flat file has no header row.

Thank you,
Neon520
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top