+ Reply to Thread
Results 1 to 4 of 4

VBA code to import .txt file and separate in columns

  1. #1
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2010
    Posts
    25

    VBA code to import .txt file and separate in columns

    Hi Everyone,

    I'm sort of new to VBA and am looking for a code that would enable to me press a command button, select a txt file that is not tab delimited, and to insert in the coding where to separate in columns using the number of characters. Is this something regular you guys can help with?

    Many Thanks!

    Joshua

  2. #2
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: VBA code to import .txt file and separate in columns

    Sorry I forgot to mention, the txt file would have to be imported on a different sheet. Thanks! My Excel version is 2010 if this matters.

  3. #3
    Registered User
    Join Date
    10-27-2015
    Location
    CT, USA
    MS-Off Ver
    2010
    Posts
    36

    Re: VBA code to import .txt file and separate in columns

    Here you go. This code should send you on your way. The credit goes to sitestory.dk. I came across this on my travels to import .csv format file.
    There are explanations here and there to help you understand what you are dealing with.

    Hope this helps!


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: VBA code to import .txt file and separate in columns

    Thanks, that worked perfectly with a bit of tweaking! +Reps

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Import Macro to import separate files to separate worksheets - deletes existing worksheets
    By Hondahawkrider in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2015, 02:24 PM
  2. Separate csv file by columns
    By goldcoast in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2012, 07:08 PM
  3. Locate CSV file with Open File msg box and Import Columns to worksheet
    By Arshmaan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2011, 01:40 AM
  4. VBA code to import text file to the fixed excel file
    By wangdian in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-30-2010, 10:13 AM
  5. Replies: 0
    Last Post: 08-10-2010, 07:00 AM
  6. Import 2 text files into 2 separate columns?
    By tcurrier in forum Excel General
    Replies: 3
    Last Post: 02-11-2006, 03:13 PM
  7. [SOLVED] Import VBA Code in Excel-File ? (Export VBA Code to file)
    By Matthias Pospiech in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2005, 01:06 PM

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