Hello,
I know there are various internet threads regarding this subject but I'm looking for something to add to my code specifically and can't seem to make it work. Here is my code:
The frmGetFilename.lblFilePath.Caption is generated on the userform using msoFileDialogFolderPicker. Anyway, I'm hoping there is a way to get the code to include filenames within subdirectories of that path.
Thanks.
I know there are various internet threads regarding this subject but I'm looking for something to add to my code specifically and can't seem to make it work. Here is my code:
Formula:

Sub GetFilenames()
Dim UserCell As Range
Dim FilePath As String
Dim Filenames As String
Set UserCell = ActiveSheet.Range(frmGetFilename.txtboxColumn.Value & frmGetFilename.txtboxRow.Value)
FilePath = frmGetFilename.lblFilePath.Caption
Filenames = Dir(FilePath)
UserCell.Select
Do While Len(Filenames) > 0
ActiveCell.Formula = FilePath & Filenames
ActiveCell.Offset(1).Select
Filenames = Dir()
Loop
End Sub
The frmGetFilename.lblFilePath.Caption is generated on the userform using msoFileDialogFolderPicker. Anyway, I'm hoping there is a way to get the code to include filenames within subdirectories of that path.
Thanks.