Dim pathFichierTxt As String, dateD As Long, heureD As Double, dateF As Long, heureF As Double
Dim tabLine() As String, iLine As Long, test As Boolean, itab As Long
Dim myFso As Object, txtFile As Object
pathFichierTxt = Range("fichierTxt").Text
dateD = CDate(Range("parametres")(1))
heureD = CDate(Range("parametres")(2))
dateF = CDate(Range("parametres")(3))
heureF = CDate(Range("parametres")(4))
Set myFso = CreateObject("Scripting.FileSystemObject")
Set txtFile = myFso.OpenTextFile(pathFichierTxt, 1)
txtFile.ReadLine
With ThisWorkbook.Sheets("Feuil1")
.Cells.ClearContents
While Not txtFile.AtEndOfStream
tabLine = Split(txtFile.ReadLine, vbTab)
On Error Resume Next
test = CDate(tabLine(0)) >= dateD And CDate(tabLine(1)) >= heureD And CDate(tabLine(0)) <= dateF And CDate(tabLine(1)) <= heureF
If Err.Number <> 0 Then test = False
On Error GoTo 0
If test Then
iLine = iLine + 1
For itab = LBound(tabLine) To UBound(tabLine)
If itab > 2 Then
.Cells(iLine, itab + 1).Value = CDbl(Replace(tabLine(itab), ".", ","))
Else
.Cells(iLine, itab + 1).Value = tabLine(itab)
End If
Next itab
End If
Wend
End With
Set txtFile = Nothing: Set myFso = Nothing