Est-il possible de faire un .find dans un tableau qui amméliore la vitesse d'exécution.
Merci
Merci
Code:
Dim WS1, WS2 As Worksheet
Dim lastrow, lastrow2, Source_inv, Source_decomposition, maxinv, maxdecomp, i, L, k, m, x As Long
Set WS1 = ThisWorkbook.Sheets("inv")
Set WS2 = ThisWorkbook.Sheets("decomposition")
maxinv = WS1.Range("A65536").End(xlUp).Row
maxdecomp = WS2.Range("A65536").End(xlUp).Row
Source_inv = WS1.Range(WS1.Range("A1"), WS1.Range("c" & maxinv)).Value
Source_decomposition = WS2.Range(WS2.Range("A1"), WS2.Range("U" & maxdecomp)).Value
Dim tablo(25000, 18) As String
For i = 1 To maxdecomp
For k = 1 To maxinv
If Source_decomposition(i, 1) = Source_inv(k, 1) Then
tablo(i, 2) = Source_inv(k, 2)
tablo(i, 1) = Source_inv(k, 3)
End If
Next k