Sub Replace_Mat_Doublon()
Dim C As Range, select_plage As Range, Ligne As Long, Ctr As Long
Set select_plage = Application.InputBox("Selectionnez la colonne ou plage de données dans laquelle remplacer le matricule :", "Selection", Type:=8)
Dim T1, i As Integer
T1 = [Tableau_Doublons]
Ligne = select_plage.Find("*", , , , xlByRows, xlPrevious).Row
Set select_plage = select_plage.Resize(Ligne - select_plage.Row + 1)
For Each C In select_plage
For i = 1 To UBound(T1)
If C.Value = T1(i, 2) Then
C.Interior.ColorIndex = 3
Ctr = Ctr + 1
End If
Next i
Next C
With select_plage
For i = 1 To UBound(T1)
.Replace what:=T1(i, 2), Replacement:=T1(i, 1), Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next i
End With
MsgBox Ctr
End Sub