View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default Counting the Number of Folders Not Files.

or without the reference

MsgBox
CreateObject("Scripting.FileSystemObject").GetFold er("C:\Temp").SubFolders.C
ount

--

HTH

Bob Phillips

"Chip Pearson" wrote in message
...
Ron,

Set a reference to the Windows Scripting Runtime library and use code such
as the following:

Dim FSO As New Scripting.FileSystemObject
MsgBox FSO.GetFolder("C:\Temp").SubFolders.Count


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


"Ron" wrote in message
...
I can count the number of files in a directory by using
foundfiles.count property, but what would I use to count
the number of folders(directories)?