Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

import multiple text files to multiple worksheet

0

Respected sir,

I do have multiple text files time and again and get the data prepared for banking industry. I use to import one by one txt file using "fixed width" function in excel worksheet. It is time taking process to import say 25 files at a time.

can you guide me how to import multiple txt files with same columns (with different width) to mulitple spreadsheet. This would be highly helpful to me and oblige

regards

girish bakhai

Post Edited
Personal Information: Personal information was removed from the post, such as an email address.
Answer
Discuss

Discussion

Please don't forget to select the answer that worked for you! Just click the Select Answer button at the bottom of the desired answer.
don (rep: 1989) Nov 22, '17 at 10:44 am
Add to Discussion

Answers

0

Start by recording a macro with the precise key strokes you use to do one import.

  1. Open one of the text files
  2. Select the target worksheet
  3. Start the macro recorder
  4. Complete the import
    If you hit a wrong key, start over again.
  5. Close the TXT file
  6. Stop the macro recorder

Next:-

  1. Open another text file
  2. Select the target worksheet
  3. Run the macro

If everything works as expected it should import the TXT file into the pre-selected worksheet and close the source file. If it doesn't, post your code here together with a narrative of your experience.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login