+ Reply to Thread
Results 1 to 4 of 4

Import Multiple Text Files into Single Workbook with Different Sheets

  1. #1
    Registered User
    Join Date
    04-16-2014
    Location
    Boston, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Import Multiple Text Files into Single Workbook with Different Sheets

    So I've looked around and found several similar threads but nothing that I've been able to adapt and implement for my particluar project.

    I'm trying to create a macro that will allow the user to select a folder containing several text files (all with the .log extention), and will then import each file within the folder with a separate sheet for each file. So far I've managed to adapt a code from a different thread to import a singe file, but I've been unable to adapt it further towards what I actually want. Also, if possible, I would like each sheet in the workbook to be named after the file that was imported into it.
    Here's what I have so far, this code is working fine for importing single files and the import parameters would be constant for all files that would be imported.

    Please Login or Register  to view this content.
    Any advice or assistance that can be offered would be greatly appreciated. Thank you in advance.

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

    Re: Import Multiple Text Files into Single Workbook with Different Sheets

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

  3. #3
    Registered User
    Join Date
    04-16-2014
    Location
    Boston, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Import Multiple Text Files into Single Workbook with Different Sheets

    Thank you so much! That works fantastically!

    Now, to build on this further, is there any way of using a range on one sheet of the workbook to identify which files to import, say by having the directories for each file in a list, rather than selecting them one by one?

    This range would have to be dynamic, so that the number of files that would be imported could vary.

    Any further help with this project would be greatly appreciated.

  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 Text Files into Single Workbook with Different Sheets

    rather than selecting them one by one?
    The code provided WILL allow you to select more than one file.


    This code assumes the path is in Column A and has a column header.
    It uses the same Subs as above.

    Please Login or Register  to view this content.

+ 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 Multiple Text Files into one worksheet each as single cell
    By drdix in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2013, 06:40 PM
  2. [SOLVED] Import multiple csv files into current workbook as separate sheets
    By santosh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-31-2013, 04:19 AM
  3. Import Multiple Text Files Into Single Worksheet
    By cozandeffect in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-03-2011, 12:23 AM
  4. Replies: 2
    Last Post: 08-30-2007, 12:34 PM
  5. Replies: 0
    Last Post: 01-13-2005, 07:06 PM

Tags for this Thread

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