Option
Explicit
Const
c_sPFAD
As
String
= "c:\Test\"
Sub
einlesen()
Dim
fil
As
Object
With
CreateObject(
"scripting.filesystemobject"
)
For
Each
fil
In
.getfolder(c_sPFAD).Files
Cells(Rows.Count, 1).
End
(xlUp).Offset(1, 0).Value = fil.Name
Next
fil
End
With
End
Sub
Sub
umbenennen()
Dim
c
As
Excel.Range
With
CreateObject(
"Scripting.FileSystemObject"
)
For
Each
c
In
Range(Cells(2, 2), Cells(Rows.Count, 2).
End
(xlUp))
If
Not
c.Value = vbNullString
Then
.GetFile(c_sPFAD & c.Offset(0, -1).Value).Name = c.Value
End
If
Next
c
End
With
End
Sub