MB ZAhl bei Verzeichnis
11.11.2003 08:11:34
Silke
Ich habe aus diesem Forum folgendes mal ausprobiert
Dim dateiform As String
Dim i As Long, totfiles As Long
Dim geffile As String, dname As String
Dim suchpfad As String, suchbegriff As String
Dim oldstatus As Variant
suchpfad = InputBox("Gebe Dateipfad an:", "Pfad definiere", Application.DefaultFilePath)
If suchpfad = "" Then Exit Sub
dateiform = InputBox("Dateityp:", "Dateierweiterung", "*.*")
If dateiform = "" Then Exit Sub
Application.ScreenUpdating = True
oldstatus = Application.StatusBar
With Application.FileSearch
.LookIn = suchpfad
.SearchSubFolders = True
.Filename = dateiform
If .Execute() > 0 Then
totfiles = .FoundFiles.Count
Application.StatusBar = "total" & totfiles & "gefunden"
For i = 1 To .FoundFiles.Count
geffile = .FoundFiles(i)
Application.StatusBar = "Datei" & i & "von" & totfiles
Cells(i, 1) = geffile
Cells(i, 2) = FileLen(geffile)
Next
End If
End With
Application.StatusBar = oldstatus
Application.ScreenUpdating = True
Es funktioniert auch wunderbar, nur die Dateigrösse möchte ich etwas anders haben, ich möchte nämlich wenn die Dateigröße unter 1 MB ist es nachher dort steht "500 KB" statt nur 500, und wenn es über 1 MB geht, durch 1024 geteilt wird und mitlediglich einer Nachkommastelle steht "3,5 MB"
Wer kann mir helfen ?
Gruss
Silke