Hello,
I have the following subroutine which enables me to select a file on my C drive. However, when it shows the files, I would like it to
only show the files that are of ".txt" file type and hide the rest.
Here's the code:
Sub SelectFiles()
'Declare a variable as a FileDialog object and create a FileDialog object as a File Picker dialog box
Dim iFileSelect As FileDialog
Set iFileSelect = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
If iFileSelect.Show = -1 Then
For Each vrtSelectedItem In iFileSelect.SelectedItems
MyPath = vrtSelectedItem ' MyPath will have the filename the program is exported to
Next vrtSelectedItem
End If
Set iFileSelect = Nothing
End Sub
What would have to be modified in the above code for the dialog box to show only the .txt file types?
thanks all for help!
rn
Bookmarks