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