Hi again,
I have another question!
I have written this function to open a dialog box to allow the user to select the text file to read
Function getFile() As String
Dim fd As FileDialog
Dim ffs As FileDialogFilters
Dim fname As String
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
Set ffs = .Filters
With ffs
.Clear
.Add "Text Files", "*.txt"
End With
.AllowMultiSelect = False
If .Show = False Then Exit Function
getFile = .SelectedItems(1)
End With
End Function
which works fine. My question is, how can I update this function to also allow files without extensions to be shown?
The researcher who will be applying my macro usually forgets to save the data in a .txt file and instead leaves them without extensions.
I'm currently running the function without the line
.Add "Text Files", "*.txt"
which shows all files, but if the folder in question contains a lot of other files this seems needlessly messy.
Many thanks
Bookmarks