mit folgendem Code will ich alle in einem Ordner vorhandenen Dateien auflisten lassen. Der Code funktioniert, listet aber nur Excel-Dateien. Ich möchte aber alle Dateien aufgelistet bekommen. Was muß ich ändern?
Danke schon mal
Ines
Sub ScanDir()
Dim irow As Long, icounter As Long
Dim icol As Integer
irow = 1
icol = 1
With Application.FileSearch
.LookIn = Range("a1").Value
.SearchSubFolders = True
.Execute
For icounter = 1 To .FoundFiles.Count
irow = irow + 1
If irow = 65537 Then
irow = 2
icol = icol + 1
End If
Cells(irow, icol).Value = .FoundFiles(icounter)
Cells(irow, icol).Hyperlinks.Add Cells(irow, icol), .FoundFiles(icounter)
Cells(irow, icol + 1).Value = FileDateTime(.FoundFiles(icounter))
Next icounter
End With
Columns.AutoFit
End Sub