AW: Ordner per Excel-Liste erstelln
12.09.2020 00:34:04
fcs
Hallo Jaschke,
hier ein entsprechendes Makro.
LG
Franz
Sub Projektordner_erstellen()
Dim rng As Range
Dim sBasis As String
Dim sOrdner As String, sVerzeichnis As String
If MsgBox("Jetzt Projektordner anlegen?", vbQuestion + vbOKCancel) = vbCancel Then Exit Sub
sBasis = "C:\Projektordner"
If Dir(sBasis, vbDirectory) = "" Then
MsgBox "Verzeichnis """ & sBasis & """ existiert nicht!", vbOKOnly, _
"Projekt-Ordner erstellen"
Else
sBasis = sBasis & Application.PathSeparator
With ActiveSheet
For Each rng In .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp)).Cells
sOrdner = Trim(rng.Text)
If sOrdner "" Then
sVerzeichnis = sBasis & sOrdner
If Dir(sVerzeichnis, vbDirectory) = "" Then
VBA.MkDir sVerzeichnis
End If
End If
Next
End With
End If
End Sub