Thread: Files in a dir
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leyton[_2_] Leyton[_2_] is offline
external usenet poster
 
Posts: 3
Default Files in a dir

You could use the FileSystemObject:

Sub test()
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder("D:\Temp\Test")
Set Files = folder.Files

' Get the Count
Debug.Print Files.Count

Set folder = Nothing
Set Files = Nothing
Set fso = Nothing

End Sub

Cheers

Leyton

-----Original Message-----
Can anyone tell me a small loop of code to find the total
number of files in a dir ?
.