Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Directory List

Is there a macro out there that will list all the names of files in a folder
I specify?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Directory List

Hi Dominique

One way

Run this with a empty sheet active

Sub test2()
Dim i As Long
With Application.FileSearch
.NewSearch
.LookIn = "c:\Data"
.SearchSubFolders = False
.MatchTextExactly = False
.FileType = msoFileTypeAllFiles
If .Execute(msoSortOrderDescending) 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
Cells(i, 1).Value = .FoundFiles(i)
Cells(i, 2).Value = FileDateTime(.FoundFiles(i))
Cells(i, 3).Value = FileLen(.FoundFiles(i))
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dominique Feteau" wrote in message ...
Is there a macro out there that will list all the names of files in a folder
I specify?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Directory List

Dominique,

Or my "List Files" Excel add-in will do that.
It finds files with the extension you specify, such as *.xls, in the folder
you specify and returns a list on a new worksheet.
Each file is hyperlinked and gives the file name, path, size and date last modified.
It can be sorted.
Comes with a one page install/use Word.doc.
Available free upon direct request. Remove xxx from my email address.

Regards,
Jim Cone
San Francisco, CA
XX


"Dominique Feteau" wrote in message ...
Is there a macro out there that will list all the names of files in a folder
I specify?
Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of Files in A Directory JaneC Excel Discussion (Misc queries) 2 February 18th 06 12:11 PM
list directory in EXCEL Bob Phillips Excel Discussion (Misc queries) 1 January 17th 06 04:23 PM
List of folders in a certain directory woolyhedgehog Excel Discussion (Misc queries) 1 October 19th 05 04:28 PM
lIST dIRECTORY ianripping[_57_] Excel Programming 5 November 12th 04 04:10 PM
list box- list all files ina directory suee Excel Programming 9 April 7th 04 02:32 AM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"