Sub ImporteDonnee()
Dim Principal As ThisWorkbook
Dim indice As Integer
Dim Repertoire As String
Dim Fichier As String
Dim Feuille As Worksheet
Dim Reponse As String
Application.ScreenUpdating = True
Set Principal = ThisWorkbook
Repertoire = ThisWorkbook.Path + "\"
ChDir Repertoire
' fichier = Dir("*.xlsx")
Fichier = Dir(Repertoire + "\*.xls")
On Error GoTo 0
indice = 1
Do While Fichier <> ""
If Fichier <> Principal.Name Then
Workbooks.Open Repertoire + "\" + Fichier
Principal.Sheets("feuil1").Cells(indice, 1).Value = ActiveWorkbook.Path
Principal.Sheets("feuil1").Cells(indice, 2).Value = ActiveWorkbook.Name
Principal.Sheets("feuil1").Cells(indice, 3).Value = ActiveWorkbook.Sheets("feuil1").Cells(3, 2).Value
Principal.Sheets("feuil1").Cells(indice, 4).Value = ActiveWorkbook.Sheets("Feuil1").FormulaR1C1 = "=AVERAGE(R[13]C[0]:R[1983]C[0])"
ActiveWorkbook.Close False
End If
Fichier = Dir
indice = indice + 1
Loop
On Error Resume Next
End Sub