+ Reply to Thread
Results 1 to 2 of 2

Auto look through subfolders

  1. #1
    Registered User
    Join Date
    01-31-2006
    Posts
    3

    Auto look through subfolders

    Please help.

    I can write a macro that will extract data from all excel files in a specific folder.

    What I need to be able to do is write a macro that will automatically extract data from excel files within folders and sub folders and sub sub folders etc

    For example the data is all held on the following directory:

    H:\development forms\2006 cost sheets\

    And within that directory by customer - for example Tesco, Boots, Asda etc. These customers are then subdivided into product ranges - eg 1,2,3,4 etc and some futher subdivided by national or exclusive. All the excel files are in exactly the same format. I need to extract the exact same data from each cost sheet into one workbook.

    There are approximately 450 cost sheets at present, which changes on a daily basis. I have a macro that will look mat all the files within an individual folder, but as I need to refresh this several times during the day it does take too long to search through every sub folder.

    I should point out that my Macro skills are very limited.

    I do hope somebody can help.

    Paul Grewer

  2. #2
    Tushar Mehta
    Guest

    Re: Auto look through subfolders

    Assuming you have a subroutine that has a parameter of the folder-to-be-
    searched...

    Whatever method you are using to find the files in the folder has a
    complimentary method to identify the sub-folders. Use that to loop through
    all the sub-folders calling the same subroutine for each folder.

    This recursive algorithm is the easiest to implement.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    >
    > Please help.
    >
    > I can write a macro that will extract data from all excel files in a
    > specific folder.
    >
    > What I need to be able to do is write a macro that will automatically
    > extract data from excel files within folders and sub folders and sub
    > sub folders etc
    >
    > For example the data is all held on the following directory:
    >
    > H:\development forms\2006 cost sheets\
    >
    > And within that directory by customer - for example Tesco, Boots, Asda
    > etc. These customers are then subdivided into product ranges - eg
    > 1,2,3,4 etc and some futher subdivided by national or exclusive. All
    > the excel files are in exactly the same format. I need to extract the
    > exact same data from each cost sheet into one workbook.
    >
    > There are approximately 450 cost sheets at present, which changes on a
    > daily basis. I have a macro that will look mat all the files within an
    > individual folder, but as I need to refresh this several times during
    > the day it does take too long to search through every sub folder.
    >
    > I should point out that my Macro skills are very limited.
    >
    > I do hope somebody can help.
    >
    > Paul Grewer
    >
    >
    > --
    > grewpp
    > ------------------------------------------------------------------------
    > grewpp's Profile: http://www.excelforum.com/member.php...o&userid=31005
    > View this thread: http://www.excelforum.com/showthread...hreadid=512144
    >
    >


+ 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