excel vba‎ > ‎

VBA - Selecting multiple files

posted Oct 1, 2010, 2:25 AM by Roberto Felicini
Sub GetImportFileName2()
      Dim FileNames As Variant
      Dim Msg As String
      Dim As Integer
      FileNames = Application.GetOpenFilename(MultiSelect:=True)
      If IsArray(FileNamesThen
          Msg = "You selected:" & vbNewLine
          For I = LBound(FileNamesTo UBound(FileNames)
              Msg = Msg & FileNames(i& vbNewLine
          Next i
          MsgBox Msg
      Else
          MsgBox "No files were selected."
      End If
  End Sub

Comments