Hi guys,
I would like to add a file extension check to this code. The file must be a CSV file. How would I go about performing that task? Additionally, can the solution also be used for different file extensions?
Thanks!
I would like to add a file extension check to this code. The file must be a CSV file. How would I go about performing that task? Additionally, can the solution also be used for different file extensions?
Thanks!
Code:
'-------------- Open CSV File
MsgBox "Please Select the .CSV File to be Analysed"
Dim CSV As Long
With Application.FileDialog(msoFileDialogOpen) ' Open the file dialog
.AllowMultiSelect = True
.Show
For CSV = 1 To .SelectedItems.Count ' Display paths of each file selected
Workbooks.Open .SelectedItems(CSV) 'OPEN the selected file
Next CSV
End With