LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Getting names of files in subdirectories

The following procedures will loop through a specified directory and
pull all the file names. Is there a way to adjust this code to loop
through a directory and all of it's subdirectories and pull the file
names and paths.

TIA

David

Sub Get_File_Names(SearchDir As String)
Dim FoundFiles
Dim FileName As String
Index = 1
FoundFiles = DirList(SearchDir)
End Sub

Function DirList(Indir As String)
Dim FileMatrix(1 To 500)
On Error Resume Next
ListFile = Dir(Indir)
'
Index = 1
Do While Not ListFile = ""
FileMatrix(Index) = ListFile
Range("SourceFiles1").Rows(Index).Value = Indir & ListFile
Index = Index + 1
ListFile = Dir()
Loop
End Function


 
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
All Subdirectories Jim Thomlinson[_4_] Excel Programming 10 July 3rd 07 09:50 PM
import few text files from subdirectories bratek Excel Programming 7 July 26th 06 01:14 PM
list of all subdirectories in a given directory in excel Peter STEVENS Excel Worksheet Functions 3 February 11th 06 03:32 PM
Subdirectories Skip[_4_] Excel Programming 4 August 31st 04 05:59 PM
Change names of files in a folder to match names in Excel Column saybut Excel Programming 4 February 9th 04 06:26 PM


All times are GMT +1. The time now is 11:15 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"