+ Reply to Thread
Results 1 to 12 of 12

Import one column in many txt files in to one excel sheet

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Import one column in many txt files in to one excel sheet

    Hi everybody,

    I am one problem with importing txt files into excel sheet. I hope everybody can help me. I have many txt files with similar content. Each txt file has 3 columns and I want to import only 1 column (the centered one) of each txt file into one comlumn in excel. All of columns in excel should be in one sheet. I tried to figure out in the forum but I could not find any problem like this. I attach one txt file for example.

    Thank you very much for everybody's help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Import one column in many txt files in to one excel sheet

    Maybe this can get you started. Change path to yours.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Import one column in many txt files in to one excel sheet

    Thank you very much. But it works with only one txt file. Could I import many txt files into only one excel sheet ? Because I have hundreds of txt files, so that it is difficult to do it one by one. Thank you very much.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Import one column in many txt files in to one excel sheet

    Try this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Import one column in many txt files in to one excel sheet

    When I pressed Alt+F8, I could not browse any txt files. Could you please help me to check it again? Thank you very much for your help.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Import one column in many txt files in to one excel sheet

    It's a Folder picker, not a File picker.

    The code will do the job with all the txt files in that folder.

  7. #7
    Registered User
    Join Date
    03-19-2013
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Import one column in many txt files in to one excel sheet

    1.jpg2.jpg
    I tried with the folder but it still does not work. It showed some error as in the pictures. Could you explain in details ? I am not good at excel so that I apologize for bad question or steps. Thank you very much.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Import one column in many txt files in to one excel sheet

    Are you sure that you are running my code?

    My code should not produce such error.....

    Try the attached.
    Just select the folder when Folder picker comes up and click "OK".
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-19-2013
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Import one column in many txt files in to one excel sheet

    I try again your code even with another computer, however it still shows that kind of error (error 53).

    Could be some thing wrong with my software ?

    Could you try again with my txt files? (attached file)
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Import one column in many txt files in to one excel sheet

    Attached are the files.

    test with code.xlsm has result.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-19-2013
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Import one column in many txt files in to one excel sheet

    Thank you very much. I found what the problem is. In the code I should change something and it works well.

    Please Login or Register  to view this content.
    Replace the red one by blue one

    Please Login or Register  to view this content.
    Anyway, I would like to thank you very much for your help.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Import one column in many txt files in to one excel sheet

    Ahhh, it should...

    Good effort and mark the thread as "Solved", if it does what you wanted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1