+ Reply to Thread
Results 1 to 3 of 3

Import data from files in folder with a given word/text in the file name

  1. #1
    Registered User
    Join Date
    04-12-2016
    Location
    Oklahoma, USA
    MS-Off Ver
    Office 2007-2010
    Posts
    30

    Import data from files in folder with a given word/text in the file name

    I'm interested in using a macro that can go into a folder and find all files in the folder with a given word or phrase included in the file name (e.g. "May"). For each file that has this word in its name, the macro should pull data from the tab labeled "Data". The data from each file should be copied to the 1st tab of the excel file with the macro (the "Collector" file). The top row of the "Collector" file will have the headings, so the data from the 1st file in the folder should be brought in starting in row 2 of the "Collector" file. The 2nd file (if there is one), should be placed in this same tab of the "Collector" file under the data from the 1st file from the folder. This process should be repeated until all data from the files with the specified word/phrase have been brought into the 1st tab of the "Collector" file.

    The data from the excel files in the folder may change, so the old data in the "Collector" file should be cleared before updating with new data each time the macro is run.

    Any thoughts?
    Last edited by runnerD2016; 05-12-2016 at 02:50 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Import data from files in folder with a given word/text in the file name

    Here's a free add-in that could do this...
    RDBMerge, Excel Merge Add-in

    If you want to write your own custom macro, here's example code that may help.
    https://msdn.microsoft.com/en-us/lib...ffice.12).aspx
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    04-12-2016
    Location
    Oklahoma, USA
    MS-Off Ver
    Office 2007-2010
    Posts
    30

    Re: Import data from files in folder with a given word/text in the file name

    Thanks! This add-in seems to do the trick.

+ 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 from a Folder using VBA
    By AGALLEGOS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2014, 01:54 AM
  2. Need to retain text format in code to import all csv files in folder
    By rebubula in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2014, 06:04 PM
  3. Auto import data from all text files in a folder (VBA)
    By anto80mtl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2013, 12:34 PM
  4. Replies: 0
    Last Post: 08-10-2012, 02:32 AM
  5. How to import all text files (column wise) from a folder?
    By Amit1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2012, 02:25 AM
  6. Replies: 17
    Last Post: 12-06-2011, 11:50 AM
  7. Import all access files from a folder to a single excell file
    By wali in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2009, 05:04 AM
  8. import all text files in folder
    By shoshanako in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2008, 10:01 AM

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