Selecting multiple files : GetOpenFilename « File Path « VBA / Excel / Access / Word






Selecting multiple files

 
  Sub GetImportFileName2()
      Dim FileNames As Variant
      Dim Msg As String
      Dim I As Integer
      FileNames = Application.GetOpenFilename(MultiSelect:=True)
      If IsArray(FileNames) Then
          Msg = "You selected:" & vbNewLine
          For I = LBound(FileNames) To UBound(FileNames)
              Msg = Msg & FileNames(i) & vbNewLine
          Next i
          MsgBox Msg
      Else
          MsgBox "No files were selected."
      End If
  End Sub

 








Related examples in the same category

1.Application.GetOpenFilename
2.Load excel file
3.Get the selected file name in a file open dialog
4.Use filter in Open file dialog