Sub Redim_preserveRow(ByRef Tablo, minLig, MaxLig)
Dim L
L = Evaluate("ROW(" & minLig & ":" & MaxLig & ")")
Tablo = Application.Index(Tablo, L, 0)
End Sub
Sub compare_3()
Dim ncol%, i%, j%, reduclg%, wb1 As Workbook
Dim tablo1, tablotemp As Variant
Dim ws1 As Worksheet
Dim Fichier1 As Variant
reduclg = 100
ncol = 10
Fichier1 = Application.GetOpenFilename("CSV Files (*.CSV), *.csv")
If Fichier1 = False Then MsgBox "Ouvrez '" & Fichier1 & "'...": Exit Sub ' pas de fichier on quitte
On Error Resume Next
Set wb1 = Workbooks.Open(Filename:=Fichier1, Local:=True)
If wb1 Is Nothing Then MsgBox "Ouvrez '" & Fichier1 & "'...": Exit Sub
tablo1 = wb1.Sheets(1).[A1].CurrentRegion.Resize(, ncol) 'matrice, plus rapide
Redim_preserveRow tablo1, 5, 10
End Sub