Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
make a list of files in a directory
Is there a way for excel to list the files in a directory including
subdirectories. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
make a list of files in a directory
from Excel help
Set fs = Application.FileSearch With fs .LookIn = "C:\Documents and Settings\rdrummon\Desktop" .SearchSubFolders = True .Filename = "cmd*" If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count MsgBox .FoundFiles(i) Next i Else MsgBox "There were no files found." End If End With this example searches for all files starting with cmd, take out the line ..Filename = "cmd*" to search for all files. Hope this helps Rowan "GFN" wrote: Is there a way for excel to list the files in a directory including subdirectories. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
make a list of files in a directory
Sub ListFiles02(FileDir) 'Using FileSearch to list the files in a directory Dim i As Integer i = 1 With Application.FileSearch NewSearch LookIn = FileDir FileName = "*.*" SearchFolders = False Execute For i = 1 To .FoundFiles.Count Range("A" & i).Value = .FoundFiles(i) Range("B" & i).Value = FileLen(.FoundFiles(i)) Range("C" & i).Value = FileDateTime(.FoundFiles(i)) Next End With End Sub -- Kaak ------------------------------------------------------------------------ Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513 View this thread: http://www.excelforum.com/showthread...hreadid=391205 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
is there a add-on for excel to make mp3 list from directory | Excel Discussion (Misc queries) | |||
Combo box with list of xls files in a directory | Excel Discussion (Misc queries) | |||
List of Files in A Directory | Excel Discussion (Misc queries) | |||
Directory List of Excel Files | Excel Programming | |||
list box- list all files ina directory | Excel Programming |