Sub MAJ()
Dim h1#, h2#, h3#, h4#, h5#, h6#, x%, texte$, s, v, n1&, tablo1(), n2&, tablo2(), n3&, tablo3()
h1 = [E3]: h2 = [E4]: h3 = [E6]: h4 = [E7]: h5 = [K3]: h6 = [K4]
x = FreeFile
Open ThisWorkbook.Path & "\LP - Test.csv" For Input As #x
While Not EOF(1) 'EndOfFile : fin du fichier
Line Input #x, texte
s = Split(texte, ";")
v = s(2)
If IsDate(v) Then 'élimine la 1ère ligne
v = TimeValue(v)
If v >= h1 And v <= h2 Then
ReDim Preserve tablo1(3, n1) 'base 0
tablo1(0, n1) = v
tablo1(1, n1) = CDbl(s(4))
tablo1(2, n1) = CDbl(s(5))
tablo1(3, n1) = CDbl(s(6))
n1 = n1 + 1
End If
If v >= h3 And v <= h4 Then
ReDim Preserve tablo2(3, n2) 'base 0
tablo2(0, n2) = v
tablo2(1, n2) = CDbl(s(4))
tablo2(2, n2) = CDbl(s(5))
tablo2(3, n2) = CDbl(s(6))
n2 = n2 + 1
End If
If v >= h5 And v <= h6 Then
ReDim Preserve tablo3(3, n3) 'base 0
tablo3(0, n3) = v
tablo3(1, n3) = CDbl(s(4))
tablo3(2, n3) = CDbl(s(5))
tablo3(3, n3) = CDbl(s(6))
n3 = n3 + 1
End If
End If
Wend
Close #x
'---restitution---
Application.ScreenUpdating = False
With Feuil1 'CodeName
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
.Rows("11:" & .Rows.Count).ClearContents 'RAZ
If n1 Then .[B11].Resize(n1, 4) = Application.Transpose(tablo1) 'Transpose est limitée à 65536 lignes
If n2 Then .[G11].Resize(n2, 4) = Application.Transpose(tablo2)
If n3 Then .[L11].Resize(n3, 4) = Application.Transpose(tablo3)
End With
End Sub