Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Two Columns of Flat File to Final Excel File
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 dont need all of the data in the flat file. I dont think there is a €śdirect way€ť to get this done, so heres what Im 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 dont 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 thats 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€ť doesnt 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Two Columns of Flat File to Final Excel File | Excel Programming | |||
how do I convert an excel file to a flat text file | Excel Discussion (Misc queries) | |||
Convert excel file to flat text file | Excel Discussion (Misc queries) | |||
Convert excel file to flat text file | Excel Discussion (Misc queries) | |||
write out a flat file with fixed columns | Excel Programming |