View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default File List Creation

Rob

Try this

Sub ListFiles()

Dim FName As String
Dim i As Long

i = 1
FName = Dir("c:\Dick\*.txt")

Do While Len(FName) 0
ActiveSheet.Cells(i, 1).Value = FName
FName = Dir
i = i + 1
Loop

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"robert" wrote in message
...
Hello,

I'm trying to find a way to create a file list.
Right now I go to "dos" and do a dir *.txt list.txt
and then strip out by hand what I dont' need bytes dates etc.

Is there a way to do this in excel using vb

thanks
rob