Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Two Columns of Flat File to Final Excel File Neon520 Excel Programming 1 February 9th 09 07:55 PM
Copy Two Columns of Flat File to Final Excel File Neon520 Excel Programming 0 February 9th 09 07:11 PM
how do I convert an excel file to a flat text file Lannutslp Excel Discussion (Misc queries) 1 June 3rd 05 10:17 AM
Convert excel file to flat text file Lannutslp Excel Discussion (Misc queries) 1 June 1st 05 03:48 AM
write out a flat file with fixed columns Steve[_35_] Excel Programming 3 August 29th 03 09:04 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"