Bonjour a toutes et a tous,

je voudrai savoir si une personne pourrai me venir en aide pour m'expliquer ce code.
J'ai essayé sans succes tester ce code mais erreur sur erreur.
Si une ame charitable pourrai m'aider.

En vous remerciant d'avance.

Tomtom

Pour info j'ai plus de 53 000 mille lignes...

Voici le code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Sub AppelSub()
  Set TableSource = Range("A2:B1200") ' champ table source
  Set ClésCherchées = Range("I2:I68000") ' champ des clés recherchées
  Set Résultat = Range("J2:J68000") ' champ résultat
  colResult = 2
  Rechv ClésCherchées, TableSource, 2, Résultat
End Sub
 
Sub Rechv(ClésCherchées, TableSource, colRésult, Résultat)
  Application.ScreenUpdating = False
  Set d = CreateObject("Scripting.Dictionary")
  a = TableSource.Value ' table source
  b = ClésCherchées.Value ' table des clés recherchées
  For i = LBound(a) To UBound(a)
    d(a(i, 1)) = a(i, colRésult)
  Next i
  Dim temp()
  ReDim temp(LBound(b) To UBound(b), 1 To 1)
  For i = LBound(b) To UBound(b)
    If d(b(i, 1)) <> "" Then temp(i, 1) = d(b(i, 1)) Else temp(i, 1) = "Inconnu"
  Next i
  Résultat.Value = temp
End Sub