+ Reply to Thread
Results 1 to 5 of 5

Import multiple .txt files to multiple sheet

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Import multiple .txt files to multiple sheet

    Hi all,

    I need to create a dynamic template for importing data from multiple .txt files to my workbook on a daily basis.

    I recorded the macro for importing ONE txt files and starting to deveop it into looping through multiple txt files and sheets but to no avail.

    1) Currently I have 4 named ranges
    FileLocation = Location of my source file
    FileName = All the file names of my txt files
    SheetDestination = The sheet to be paste for each txt file (further explaination below)
    FileFormat = .txt (for VBA purpose)

    2) The macro recorded was in "ActiveSheet", thus I thought of looping through each sheet (put the activate code at the first line) for the codes to run.

    3) ColA ColB
    1 SP.txt
    2 IND.txt
    3 US.txt
    4
    5
    6
    Column A is my SheetDestination, while Column B is the respective filename for source txt file. My final intended result would be simply macthing sheet 1 against SP, sheet 2 against IND, sheet 3 against US... so on and so forth....

    Attached is my sample file, with the codes I tried so far....

    Appreciate if anyone could assist. I would provide further details for any unclear areas.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: Import multiple .txt files to multiple sheet

    self bump!

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Import multiple .txt files to multiple sheet

    I second that bump just to illustrate how little patience this OP has.



  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Import multiple .txt files to multiple sheet

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  5. #5
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: Import multiple .txt files to multiple sheet

    Hi Tinbendr,

    Thank you for your kind assistance.
    Very much appreciated.

    Regards.

+ 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 datas form multiple excel files to master sheet for consolidation
    By laxmananm in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-06-2014, 11:11 AM
  2. Macro to import multiple text files into one excel (2007) sheet
    By schthi3 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-08-2013, 11:35 AM
  3. Replies: 4
    Last Post: 05-17-2013, 05:29 AM
  4. Import tables from multiple Word files into a sheet of Excel
    By magdy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2012, 03:53 AM
  5. Replies: 2
    Last Post: 08-30-2007, 12:34 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