- Katılım
- 2 Mart 2005
- Mesajlar
- 2,960
- Excel Vers. ve Dili
-
ev: Ofis 2007- Win Xp
iş: Ofis 2010- Win Vista
http://www.excel.web.tr/attachment.php?attachmentid=48811&d=1221095354Ekli örnek dosyada kod içerisinde belirtilen D sürücüsündeki xls uzantılı dosyaları a sutununa listeler (alt klasörler de dahil)
Bu listelemeye birde link verdirebilirsek, ayrıca D sürücüsü yerine bütün sürücülerde aramasını sağlayabilrsek sanırım istediğiniz olalcak.
Üstatlarımız kodu geliştirebilirler.
http://img204.imageshack.us/img204/6272/hata445tn5.jpg
Kod:
Function CreateFileList(FileFilter As String, IncludeSubFolder As Boolean) As Variant
Dim FileList() As String, FileCount As Long
CreateFileList = ""
Erase FileList
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.Filename = FileFilter
.SearchSubFolders = IncludeSubFolder
If .Execute(SortBy:=msoSortByFileName, SortOrder:=msoSortOrderAscending) = 0 Then Exit Function
ReDim FileList(.FoundFiles.Count)
For FileCount = 1 To .FoundFiles.Count
FileList(FileCount) = .FoundFiles(FileCount)
Next
End With
CreateFileList = FileList
Erase FileList
End Function
