View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Directory Search

Try something like the following:

Dim FSO As Object
Dim Fldr As Object
Const FOLDER_NAME = "C:\Temp"
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each Fldr In FSO.getfolder(FOLDER_NAME).subfolders
Debug.Print Fldr.Name
Next Fldr


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"cogent" wrote in message
...
Hello

I know how to use the File.Search function. What do I do if I

only want the
names of the folders in a particular direectory instead of the

files?

Thank you!

W