VBA Ordner-Auswahl
30.07.2014 15:07:11
Raphael
ich habe im www ein schönes Makro gefunden, welches aber noch nicht ganz meinen Vorstellungen entspricht:
Sub Schaltfläche11_Klicken()
Dim zeile As Variant
Dim sFile As String, sPattern As String, sPath As String
Dim iRow As Integer
Columns(1).ClearContents
sPath = "P:\Desktop\NORTH\"
Verzeichnis an
If Right(sPath, 1) "\" Then sPath = sPath & "\"
sPattern = "*.*"
sFile = Dir(sPath & sPattern)
Do Until sFile = ""
iRow = iRow + 1
Cells(iRow, 1).Value = sFile
sFile = Dir()
Loop
For zeile = 1 To Cells.SpecialCells(xlLastCell).Row
Next
End Sub
sPath = "P:\Desktop\NORTH\" Soll aber der Ordner sein in dem die Aktuelle Datei liegt in der ich das Makro steht!
ich hoffe ihr könnt mir hier weiterhelfen.
Besten dank
Raphael