Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Searching through Subfolders

Hello

Wondering how to do a search for .htm files that are all under one
main folder, but also through a bunch of subfolders under the main
folder. The code I have so far is:

myPath = "C:\MySites\"
workfile = Dir(myPath & "*.htm")

Using this code I can only return files that are in MySites and not
the subfolders within that folder. Is there a way to do this or do I
have to name each folder within MySites?

Thanks very much
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Searching through Subfolders

Ron de Bruin shows a couple of ways:
http://www.rondebruin.nl/copy3.htm
and
http://www.rondebruin.nl/fso.htm

Mark wrote:

Hello

Wondering how to do a search for .htm files that are all under one
main folder, but also through a bunch of subfolders under the main
folder. The code I have so far is:

myPath = "C:\MySites\"
workfile = Dir(myPath & "*.htm")

Using this code I can only return files that are in MySites and not
the subfolders within that folder. Is there a way to do this or do I
have to name each folder within MySites?

Thanks very much
Mark


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Searching through Subfolders

Chip Pearson has instructions and a sample file you can download to create a
folder/file tree view - maybe that will work for you, or provide a good
starting point:
http://www.cpearson.com/excel/foldertreeview.aspx

Hope this helps,

Hutch

"Mark" wrote:

Hello

Wondering how to do a search for .htm files that are all under one
main folder, but also through a bunch of subfolders under the main
folder. The code I have so far is:

myPath = "C:\MySites\"
workfile = Dir(myPath & "*.htm")

Using this code I can only return files that are in MySites and not
the subfolders within that folder. Is there a way to do this or do I
have to name each folder within MySites?

Thanks very much
Mark

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching, matching then searching another list based on the match A.S. Excel Discussion (Misc queries) 1 December 13th 06 05:08 AM
Creating Subfolders MeTed Excel Programming 2 November 23rd 06 10:03 AM
please help me with folder and subfolders pieros Excel Programming 2 November 4th 05 12:52 PM
copy subfolders, replace text in files and save files in copied subfolders pieros Excel Programming 0 November 1st 05 12:08 PM
Get list of subfolders Darren Hill[_3_] Excel Programming 3 March 6th 05 09:28 PM


All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"