Sub Importdonnées()
Dim Masource As Range
Dim Mesvaleurs As Range
Application.ScreenUpdating = False
NbLig = Range("A1").SpecialCells(xlCellTypeLastCell).Row
Nbcol = Range("A1").SpecialCells(xlCellTypeLastCell).Column - 2
chemin = "C:\Suivi SPC"
lig = 2
fich = Dir(chemin & "\*.tra")
nom:
ThisWorkbook.Sheets("PRESSAGE").Cells(lig, 1) = fich
fich = Dir
If fich <> "" Then
lig = lig + 1
GoTo nom
End If
For num = 2 To lig
Workbooks.Open chemin & "\" & ThisWorkbook.Sheets("PRESSAGE").Cells(num, 1)
Set Masource = Range("A1:A500")
Masource.Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1))
For num2 = 2 To 11
ThisWorkbook.Sheets("PRESSAGE").Cells(num, num2 + 1) = ActiveSheet.Cells(num2, 2)
Next num2
Range("C14").FormulaR1C1 = "=average(LC(-1):L(26)C(-1))" = Range("C15")
ThisWorkbook.Sheets("PRESSAGE").Cells(num, 13) = Cells(15, 3)
ActiveWorkbook.Close SaveChanges:=False
Next num
Application.ScreenUpdating = True
End Sub