Hi, ciapul12,
maybe like this
Private Sub CommandButton7_Click()
Dim xDirect$, xFname$, InitialFoldr$
InitialFoldr$ = "G:\" '<<< Startup folder to begin searching from
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = Application.DefaultFilePath & "\"
.Title = "Please select a folder to list Files from"
.InitialFileName = InitialFoldr$
.Show
If .SelectedItems.Count <> 0 Then
xDirect$ = .SelectedItems(1) & "\"
xFname$ = Dir(xDirect$, 7)
Do While xFname$ <> ""
Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = xFname$
xFname$ = Dir
Loop
End If
End With
End Sub
This should add the names in Column A under the already filled range in Sheet3.
Ciao,
Holger
Bookmarks