I cannot find how to change this code so that the file path of the selected files are place in an existing text box (TextBox3) in my userform.
Here is the code I'm using
The above code works until files are selected. Thereafter nothing happens.
Here is the code I'm using
Code:
Private Sub CommandButton1_Click()
Dim fDialog As FileDialog, i As Integer
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
fDialog.AllowMultiSelect = True
fDialog.Title = "Select Files"
fDialog.InitialFileName = "T:\Finance\SohoMaccs\2018Maccs\Monthly Reports\"
fDialog.Filters.Add "Excel files", "*.xlsx"
If fDialog.Show = -1 Then
For Each it In fDialog.SelectedItems
Debug.Print it
Next it
End If
End Sub
The above code works until files are selected. Thereafter nothing happens.