Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving import format 1

Status
Not open for further replies.

RamziSaab

MIS
May 7, 2003
522
GB
I have txt files that need to be imported to excel they are always in the same format, however is there a way to save where the fixed columns are in the txt import wizard so i can run a macro to import and format teh files automatically.

Hope my question is clear?

thanks
 
I guess to make it clear it there a way to specify the fixed width when importing using vba
 
The simplest way is to open an blank excel spreadsheet, then start recording a macro. Open the text file, follow the wizard, and then end macro. The only problem here is the name and location of the text file.
 
Should have thought of that...thanks can modify the macro to ask user to input file name!
 
If the text files are produced with the same names, the best way to approach import is to use schema.ini files. Come back here if you need more info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top