1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| Public Sub Demarrer_Click()
Dim filt As String
Dim index As Integer
Dim cheminFichier As Variant
Dim titre As String
Dim i As Integer
Dim Msg As String
'Définit la liste des fichiers
filt = "fichiers xls (*.xls),*.xls,"
index = 3
titre = "Délectionner un fichier à importer"
cheminFichier = Application.GetOpenFilename(filefilter:=filt, Filterindex:=index, Title:=titre, MultiSelect:=True)
If Not IsArray(cheminFichier) Then
MsgBox "Aucun fichier n'a été sélectionné"
Exit Sub
End If
For i = LBound(cheminFichier) To UBound(cheminFichier)
Msg = Msg & cheminFichier(i)
Next i
'MsgBox "Vous avez sélectionné :" & vbCrLf & Msg
Workbooks.Open Filename:=Msg
Sheets(1).Select
End Sub |
Partager