Hi
I have some code which allows me to select a file to import.
However, I'd like to add .csv files to the list of files that can be shown in the list of files in the 2nd last row of code below.
Does anyone know how to do that, please?
I have some code which allows me to select a file to import.
However, I'd like to add .csv files to the list of files that can be shown in the list of files in the 2nd last row of code below.
Does anyone know how to do that, please?
VBA Code:
Sub ImportFile()
Dim fd As FileDialog
Dim filewaschosen As Boolean
Dim ExcelFile As Workbook
Dim iWB As Workbook
Application.ScreenUpdating = False
Set ExcelFile = ActiveWorkbook
Set fd = Application.FileDialog(msoFileDialogOpen)
fd.Filters.Clear
'fd.Filters.Add "xlsx files", "*.xlsx"
fd.Filters.Add "Custom Excel Files", "*.xlsx, *.xlsm, *.xls"
fd.AllowMultiSelect = False