Attribute VB_Name = "ohne_Phad" Option Explicit Sub List_Files_in_all_folder() ' einschl unterordner von Ramses Rainer ' komplett mit Phad Dim InI As Integer Dim StDateiname As String Dim Dateiform As String Dim I As Long, TotFiles As Long Dim Suchpfad As String Dim OldStatus As Variant Suchpfad = InputBox("Geben Sie den Ordner an, der durchsucht werden soll.", "Pfad definieren", Application.DefaultFilePath) If Suchpfad = "" Then Exit Sub Dateiform = InputBox("Geben Sie den Dateityp an der gesucht werden soll", "Dateierweiterung", "*.xls") If Dateiform = "" Then Exit Sub Application.ScreenUpdating = True OldStatus = Application.StatusBar With Application.FileSearch .LookIn = Suchpfad .SearchSubFolders = True ' suchen auch in Unterverzeichnis .Filename = Dateiform If .Execute() > 0 Then TotFiles = .FoundFiles.Count Application.StatusBar = "Total " & TotFiles & " gefunden" For I = 1 To .FoundFiles.Count Application.StatusBar = "Datei: " & I & " von " & TotFiles ' ergänzt Hyperlink, Dateigröße und Dateidatum ' Dateiname abtrennen For InI = Len(.FoundFiles(I)) To 1 Step -1 If Mid(.FoundFiles(I), InI, 1) = "\" Then StDateiname = Mid(.FoundFiles(I), InI + 1, Len(.FoundFiles(I)) - InI + 2) Exit For End If Next InI ' Cells(I, 1) = .FoundFiles(I) ActiveSheet.Hyperlinks.Add Anchor:=Cells(I, 1), _ Address:=.FoundFiles(I), TextToDisplay:=StDateiname ' Hyperlink Cells(I, 2) = FileLen(.FoundFiles(I)) ' Dateigröße Cells(I, 3) = FileDateTime(.FoundFiles(I)) ' Dateidatum ' ******** Next I End If End With Application.StatusBar = OldStatus Application.ScreenUpdating = True End Sub