ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SubFolders in macro (https://www.excelbanter.com/excel-programming/360020-subfolders-macro.html)

pianoman[_4_]

SubFolders in macro
 

Hi Guys,
I need some code that will allow me to search a folder "Model1", an
it's subfolders "Vend1, Vend2, Vend3" etc. for the file "Risk Filte
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 th
next Risk filter file, which will be a different subfolder. I
possible, it would then move on to the next master folder "Model2".
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 wildcar
there is fine, it's the subfolder searching that's getting me stuck.
can do all the workbook specific code... if anyone could supply th
looping subfolder searching bit, that would be excellent.

Thank you,

Garet

--
pianoma
-----------------------------------------------------------------------
pianoman's Profile: http://www.excelforum.com/member.php...fo&userid=3371
View this thread: http://www.excelforum.com/showthread.php?threadid=53713


Tom Ogilvy

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



pianoman[_7_]

SubFolders in macro
 

Thanks Tom... you're a wealth of useful info!

Ta,

Tom Ogilvy Wrote:
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




--
pianoman
------------------------------------------------------------------------
pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712
View this thread: http://www.excelforum.com/showthread...hreadid=537137



All times are GMT +1. The time now is 04:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com