Bonsoir
J'utilise la macro ci-dessous dans excel 2007.
Lorsque je l'ai utilisée la première fois elle était hyper rapide.
Aujourd'hui après plusieurs essai, elle est devenu hyper lente ( plus de 2 heure pour 30 fichier txt, et encore ça plante)
y-a-t-il une explication ?
une solution ?
merci
le code :
Sub import()
Dim Directory As String, File As String, Temp As String
Dim NumRow As Long, NumCol As Integer
Dim FF As Integer, I As Integer
Dim LigFic As Long
Directory = ThisWorkbook.Path & "\" & "fevrier08\" ' "E:\fevrier08\"
File = Dir(Directory & "*.txt")
NumRow = ActiveCell.Row
NumCol = ActiveCell.Column
With ActiveSheet
FF = FreeFile
LigFic = 0
Do While File <> ""
Open Directory & File For Input As #FF
Do While Not EOF(FF)
Line Input #FF, Temp
If LigFic > 4 Then
Table = Split(Temp, vbTab)
For I = 0 To UBound(Table)
If IsDate(Table(I)) Then
.Cells(NumRow, NumCol + I) = CDate(Table(I))
Else
.Cells(NumRow, NumCol + I) = Table(I)
End If
Next
NumRow = NumRow + 1
End If
LigFic = LigFic + 1
Loop
LigFic = 0
Close #FF
File = Dir
Loop
End With
End Sub