kennt denn jemand eine Möglichkeit, über Excel alle Unterordner eines Ordners darzustellen, also es soll sie automatisch suchen und dann in der Tabelle darstellen.
Danke schonmal im Voraus.
Sub t()
Dim FSO, FO, FU, F
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FO = FSO.GetFolder("C:\test")
Set FU = FO.SubFolders
For Each F In FU
Sheets("Tabelle1").Range("A65536").End(xlUp).Offset(1, 0).Value = F
Next F
End Sub
Sub tt()
Dim FSO, FO, FU, F
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FO = FSO.GetFolder("C:\test")
Set FU = FO.SubFolders
For Each F In FU
Sheets("Tabelle1").Range("D65536").End(xlUp).Offset(1, 0).Value = Right(F, Len(F) - InStrRev(F, "\"))
Next F
End Sub
Sub t_start()
t "C:\test"
End Sub
Sub t(ByVal strF As String)
Dim FSO, FO, FU, F
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FO = FSO.GetFolder(strF)
Set FU = FO.SubFolders
For Each F In FU
Sheets("Tabelle1").Range("A65536").End(xlUp).Offset(1, 0).Value = F
t F
Next F
End Sub
Rückmeldung wäre nett! - Grüße von Erich aus Kamp-Lintfort