Hi everyone!!
I have the following macro and it works correctly, I don't have problems:
Private Sub CommandButton7_Click()
Dim FSO As Object
Dim Folder As Object
Dim FolderName As String
Dim R As Long
Dim Rng As Range
Dim SubFolder As Object
Dim Wks As Worksheet
'Parent Directory - Change this to whichever directory you want to use
FolderName = "Q:\Proyect"
Set Wks = Worksheets("Lista")
Set Rng = Wks.Range("C2")
'Wks.UsedRange.Offset(1, 0).ClearContents
Wks.Range("C2").Offset(1, 0).ClearContents
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(FolderName)
R = 1
Rng.Cells(R, 1) = Folder.Name
For Each Folder In Folder.SubFolders
R = R + 1
Rng.Cells(R, 1) = Folder.Name
Next Folder
Set FSO = Nothing
End Sub
But now I want to add to the same list another 2 routes, for example:
Q:\scenario
Q:\List
how I can add the path in the samelist & Macro?
Best Regards!
Bookmarks