kann ich eigentlich die Dateien (nur den Namen) die sich in einem Ordner befinden irgendwie ins Excel laden?
Gruss
Markus
Gruss
Markus
Falls nur Excel Dateien:
Dim sFile As String, sPath As String
Application.ScreenUpdating = False
sPath = "C:\PFAD"
If Right(sPath, 1) <> "/" Then sPath = sPath & "\"
sFile = Dir(sPath & "*.xls")
Do While sFile <> ""
zeilennr = Range("A65536").End(xlUp).Row + 1
Cells(zeilennr, 1) = sFile
sFile = Dir()
Loop
Application.ScreenUpdating = True
Falls alle Dateien:
Dim sFile As String, sPath As String
Application.ScreenUpdating = False
sPath = "C:\PFAD"
If Right(sPath, 1) <> "/" Then sPath = sPath & "\"
sFile = Dir(sPath)
Do While sFile <> ""
zeilennr = Range("A65536").End(xlUp).Row + 1
Cells(zeilennr, 1) = sFile
sFile = Dir()
Loop
Application.ScreenUpdating = True
Den Pfad in Zeile 3 musst du noch anpassen.
Gruss
Chris
In meiner Tabelle sollte halt etwa folgendes stehen:
Datei1.txt
Datei2.doc
Datei3.jpg
...
Gern geschehen... Erwarte keine Geschenke, aber ein Hallo, Tschüss und Danke wäre nett und dass du die Antwort wenigstens ausprobierst, denn genau so funktioniert es wie gefragt.
Nachstehend noch mit Erstellungsdatum und Dateigrösse.
Dim sFile As String, sPath As String
Application.ScreenUpdating = False
sPath = "C:\PFAD"
If Right(sPath, 1) <> "/" Then sPath = sPath & "\"
sFile = Dir(sPath)
Do While sFile <> ""
zeilennr = Range("A65536").End(xlUp).Row + 1
Cells(zeilennr, 1) = sFile
Cells(zeilennr, 2) = FileDateTime(sFile)
Cells(zeilennr, 3) = FileLen(sFile)
sFile = Dir()
Loop
Application.ScreenUpdating = True
Gruss
Chris