Also einen Teil der Lösung habe ich hinbekommen:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Sub Workbook_open()
Dim i As Long
Dim cDir As String
Dim sPath As String
Dim sName As String
sPath = "C:\TEMP\"
cDir = Dir(sPath & "*.xls")
Application.ScreenUpdating = True
Do While cDir <> ""
sName = cDir
Worksheets(1).Name = sName
cDir = Dir
Loop
Application.ScreenUpdating = True
End Sub
|
Jetzt stellt sich mir nur die Frage ob man die Pfadangabe völlig rausnehmen kann und er immer die aktive Exceldatei nimmt.?