• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How To Import Text (.txt) to excel & deliminted using VBA Macro

asparagus

Member
Hello, i have file with txt file & want to import this file to excel with browse file and deliminated after import.
when i browse file txt & start to import, value from file txt doesn't show in my excel or blank only show header i set up in macro code

attached my file macros excel with code & sample .txt.

Thank You
 

Attachments

  • SHIP_180515.txt
    791.8 KB · Views: 6
  • Result.JPG
    Result.JPG
    69.6 KB · Views: 9
  • convert.xlsm
    19 KB · Views: 2
You need to modify the code. Attached code shall give you pointers. One thing I noticed is that the code that was previously written (was it copied from somewhere?) would lead to different type of results as your sample text file is fixed width type and not space delimited.
 

Attachments

  • convert.xlsm
    253.6 KB · Views: 4
Hi !​
i have file with txt file & want to import this file to excel with browse file and deliminated after import.
An easy tip to get a starter code : activate the Macro Recorder and import manually the file via Data, Import from file
just well answering to the Import Assistant, once done stop the Macro Recorder, voilà !​
 
Back
Top