+ Reply to Thread
Results 1 to 3 of 3

SubFolders in macro

  1. #1
    Registered User
    Join Date
    04-21-2006
    Posts
    61

    SubFolders in macro

    Hi Guys,
    I need some code that will allow me to search a folder "Model1", and it's subfolders "Vend1, Vend2, Vend3" etc. for the file "Risk Filter VENDCODE latest.xls", open the file, copy some cells of the "Summary" sheet onto a master sheet, and then close the file and move on to the next Risk filter file, which will be a different subfolder. If possible, it would then move on to the next master folder "Model2". I can just run that as a different sub if needs be though...
    I don't need to record the VENDCODE results or anything so a wildcard there is fine, it's the subfolder searching that's getting me stuck. I can do all the workbook specific code... if anyone could supply the looping subfolder searching bit, that would be excellent.

    Thank you,

    Gareth

  2. #2
    Tom Ogilvy
    Guest

    RE: SubFolders in macro

    http://support.microsoft.com/kb/185476/EN-US/
    How To Search Directories to Find or List Files

    http://support.microsoft.com/kb/185601/EN-US/
    HOW TO: Recursively Search Directories by Using FileSystemObject

    http://support.microsoft.com/kb/186118/EN-US/
    How To Use FileSystemObject with Visual Basic

    --
    Regards,
    Tom Ogilvy


    "pianoman" wrote:

    >
    > Hi Guys,
    > I need some code that will allow me to search a folder "Model1", and
    > it's subfolders "Vend1, Vend2, Vend3" etc. for the file "Risk Filter
    > VENDCODE latest.xls", open the file, copy some cells of the "Summary"
    > sheet onto a master sheet, and then close the file and move on to the
    > next Risk filter file, which will be a different subfolder. If
    > possible, it would then move on to the next master folder "Model2". I
    > can just run that as a different sub if needs be though...
    > I don't need to record the VENDCODE results or anything so a wildcard
    > there is fine, it's the subfolder searching that's getting me stuck. I
    > can do all the workbook specific code... if anyone could supply the
    > looping subfolder searching bit, that would be excellent.
    >
    > Thank you,
    >
    > Gareth
    >
    >
    > --
    > pianoman
    > ------------------------------------------------------------------------
    > pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712
    > View this thread: http://www.excelforum.com/showthread...hreadid=537137
    >
    >


  3. #3
    Registered User
    Join Date
    04-21-2006
    Posts
    61
    Thanks Tom... you're a wealth of useful info!

    Ta,

    Quote Originally Posted by Tom Ogilvy
    http://support.microsoft.com/kb/185476/EN-US/
    How To Search Directories to Find or List Files

    http://support.microsoft.com/kb/185601/EN-US/
    HOW TO: Recursively Search Directories by Using FileSystemObject

    http://support.microsoft.com/kb/186118/EN-US/
    How To Use FileSystemObject with Visual Basic

    --
    Regards,
    Tom Ogilvy


    "pianoman" wrote:

    >
    > Hi Guys,
    > I need some code that will allow me to search a folder "Model1", and
    > it's subfolders "Vend1, Vend2, Vend3" etc. for the file "Risk Filter
    > VENDCODE latest.xls", open the file, copy some cells of the "Summary"
    > sheet onto a master sheet, and then close the file and move on to the
    > next Risk filter file, which will be a different subfolder. If
    > possible, it would then move on to the next master folder "Model2". I
    > can just run that as a different sub if needs be though...
    > I don't need to record the VENDCODE results or anything so a wildcard
    > there is fine, it's the subfolder searching that's getting me stuck. I
    > can do all the workbook specific code... if anyone could supply the
    > looping subfolder searching bit, that would be excellent.
    >
    > Thank you,
    >
    > Gareth
    >
    >
    > --
    > pianoman
    > ------------------------------------------------------------------------
    > pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712
    > View this thread: http://www.excelforum.com/showthread...hreadid=537137
    >
    >

+ 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