+ Reply to Thread
Results 1 to 4 of 4

Running A macro through multiple files in a folder

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Running A macro through multiple files in a folder

    Hi,
    I have a excel form that is filled out in hundreds of different files and I need to compile all of the data into one file. I created a macro that creates a new sheet and extracts all of the data from the form in a single row on the new sheet. It works great but would take too long to apply individually to hundreds of files.

    Does any one have a code that allows me to select a folder and then have the macro I've already designed be applied to all of the files in the folder. Then once all of the files all have a single row of data, compile all of the rows of data onto one table.

    Thanks in advance for the help.

  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

    Re: Running A macro through multiple files in a folder

    Hello Briansva92 ,

    Welcome to the Forum!

    Seeing the code you already have and the layout of the Excel files will provide a solid starting point for coding a solution. Please attach your workbook and include any comments about how the macro should work. It is better to include too much information than not enough.

    To Attach a File:
    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.[COLOR="Silver"]
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-27-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Running A macro through multiple files in a folder

    Hi,
    I've attached a copy of the form that I'm working with. The Macro I wrote is on a tab in the document. I'm not very good with VBA so the the code is not the most efficient.

    I basically need to take all of the fields filled in by the user in the form and and put all of the data in one row. Then compile all of the data from multiple workbooks into one table.
    Attached Files Attached Files
    Last edited by Briansva92; 08-31-2012 at 12:08 PM.

  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

    Re: Running A macro through multiple files in a folder

    Hello Briansva92,

    I just got back and I am heading out again. The file downloaded with no problem. I will start working on the macro when I return. The execution speed can be improved by rewriting the macros. One more thing I need to know is the name of the folder where these files are that need to be copied.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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