+ Reply to Thread
Results 1 to 5 of 5

Search folder for excel files.

  1. #1
    Registered User
    Join Date
    03-18-2011
    Location
    Dayton, ME, USA
    MS-Off Ver
    Excel 2004 for MAC 11.5.4
    Posts
    77

    Search folder for excel files.

    Hi
    I am creating the attached workbook through VBA code on the raw data, and this part works perfectly. providing me with a summary of each day (file)

    I wanted to know if there is a way to create a code that would be able to create a master summary workbook.

    Basically I would have these daily worksheets created each day by running the macro providing a summary sheet of the data from that day (as per attached file). All of these stored in one folder on my drive.

    I would like to be able to have a new master workbook that looks at the folder where these files are stored recognizes when a new file has been added and then copies the data from that summary sheet and pastes that data as new line in the Master Summary worksheet.

    I had found some code to open newest files in a folder, but there maybe times (after a weekend) when I could have 3 days files generated and put into the folder on a Monday, so this code would only pick up the most recent. Which is why I thought a search for un-inputted files would work better.

    Would appreciate your suggestions.

    Many thanks

    Jon
    Attached Files Attached Files
    Last edited by endoskeleton; 03-27-2011 at 03:27 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Search folder for non inputted excel files.

    Hi Jon,
    I do a similar thing where I add a daily workbook to a summary workbook sheet. Instead of trying to get the most recent, I always add what is selected by the user. Then I delete Duplicates from the data. If they add a file twice, by mistake, I simply delete the duplicate data.

    I do a VBA code of Application.FindFile which brings up a dialog that they click on. I do some checks to insure it is the correct type of file, add to the bottom of my master and close it.
    I use this code to open it:
    Please Login or Register  to view this content.
    After the VBA copies and pastes stuff to the clipboard I close this file using.
    Please Login or Register  to view this content.
    I have vba to delete dups at this point.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Search folder for non inputted excel files.

    Hi

    You could do something like the following.
    Make a copy all the files you want to extract data from to a subfolder called Imports, which does not contain any other files.
    then after you have completed all the work, delete all the files in that folder, so they cannot be imported a second time.

    Then the frequency of running the code doesn't matter. If there is only 1 file in the folder, that's all that will be processed. If there are 10 there, then all 10 files will be processed.

    Please Login or Register  to view this content.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  4. #4
    Registered User
    Join Date
    03-18-2011
    Location
    Dayton, ME, USA
    MS-Off Ver
    Excel 2004 for MAC 11.5.4
    Posts
    77

    Re: Search folder for non inputted excel files.

    Great, thanks for the nice ideas. They would both work I think, but have more user involvement that I would like.

    Let me ask this :-

    Would it work do you think to get the code to add a column to my Master Summary sheet that records the file name of the data pasted. Then you could ask the code to look for all files that are not shown in that column.

    What do you think ?

    Cheers

    Jon

  5. #5
    Registered User
    Join Date
    03-18-2011
    Location
    Dayton, ME, USA
    MS-Off Ver
    Excel 2004 for MAC 11.5.4
    Posts
    77

    Re: Search folder for excel files.

    Any ideas?

+ 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