Select Multiple Files in VBA

This little program here allow your program to select multiple files and return the path for each of the selected files.

Sub GetMultipleFilesPath()
 Dim varFiles
 Dim varEle
 With Application.FileDialog(msoFileDialogFilePicker)
    If .Show = -1 Then
     .AllowMultiSelect = True
     Set varFiles = .SelectedItems
    End If
 End With
 For Each varEle In varFiles
  Debug.Print varEle
 Next varEle
End Sub
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *