modify this to suit
Sub FindandListFiles()
Application.ScreenUpdating = False
Columns(1).ClearContents
ThisRow = 2
Dim FN As String ' For File Name
Dim ThisRow As Long
Dim FileLocation As String
FileLocation = "c:\yourfolder\*.txt"
FN = Dir(FileLocation)
Do Until FN = ""
ThisRow = ThisRow + 1
Cells(ThisRow, 1) = FN
FN = Dir
Loop
Application.ScreenUpdating = True
End Sub
--
Don Guillett
SalesAid Software
(e-mail address removed)
Lee said:
Using VBA, can anyone tell me know to get all the filenames in a given
folder into an Excel spreadsheet. I would like to have each filename in a
separate cell. For example, Filename1.txt in A1, Filename2.txt in A2,
Filename3.txt in A3, etc. The number of data files (*.txt) will vary each
day.