+ Reply to Thread
Results 1 to 7 of 7

importing text files into excel -fastest way

  1. #1
    Registered User
    Join Date
    01-24-2008
    Posts
    2

    importing text files into excel -fastest way

    What is the fastest way to import text files into excel . I have a button where i click and select the file to upload..But the number of rows is more than 40,000 and takes lot of time to upload .
    The code i am using is
    Dim nm As Name

    Please Login or Register  to view this content.
    What can I do to speed up the process of importing text files into excel ?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello maran,

    Why are you using a "Query Table" to upload a local text file into Excel? Speed will vary with how complex the file layout is, and 40,000 rows multiplied by the number of columns used can become quite a large number, very fast. Using a "Query Table" is definitely going to add to your processing overhead. If you can post a sample of your text file, it would help in providing you with a better solution.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    01-24-2008
    Posts
    2
    Hello Leith Ross,

    Thanks for the answer.I am attaching a sample file. Each row has 3 columns.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello maran,

    That is a simple layout. I 'll code a VBA macro to load a text file with this format into a worksheet.

    Sincerely,
    Leith Ross

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello maran,

    This macro will split your data into 3 columns (A,B,C) starting at row 1, and place the data on the active worksheet. Place this macro in a Standard VBA module. You can then run it manually using ALT+F8 or from code. Change the Text File (shown in blue) in code to the file name you are using.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    09-21-2007
    Posts
    15
    Hi Leith,

    Just a query !

    How about text to columns options.
    If i need to use this option will that work fine.

    Will it possible to give temporarly downloaded text file as input.
    If so, Please help me out.

    Thanks,
    Sindhuja

  7. #7
    Registered User
    Join Date
    10-08-2013
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: importing text files into excel -fastest way

    I am a newbie.. I can do a lot of things in excel but not programming. This is the same task I want to achieve but am not sure what to do with the code provided above. Can someone help?

+ 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