Listing files in a directory

  • Thread starter Thread starter Andy Levy
  • Start date Start date
A

Andy Levy

Hi ya

If i wanted to list all the files in a particular directory - is there a way
to do it.

Thanks
AL
 
Hi,
Here's a routine that will print all files in a directory to the
debug window. Call it like: FindFiles "C:\"

Public Sub ListFiles(ByVal Path As String)
Dim fn As String

fn = Dir$(Path & "*.*")
While Len(fn)
Debug.Print fn
fn = Dir$
Wend

End Sub
 
Back
Top