Sub Principal()
MonChemin = ThisWorkbook.Path
Workbooks.Open Filename:=MonChemin & "\BddClient.xls"
Workbooks.Open Filename:=MonChemin & "\BddProspect.xls"
Nettoyeur
SuppDoublon "BddClient.xls", Array(1, 6, 1, 5)
SuppDoublon "BddProspect.xls", Array(1, 6, 7, 1, 6, 7)
End Sub
Sub SuppDoublon(Arg1, Arg2)
For j = 0 To ((UBound(Arg2) + 1) / 2) - 1
With Workbooks("BddSuspect.xls").Sheets("Feuil1")
For i = .Range("A65536").End(xlUp).Row To 2 Step -1
If .Cells(i, Arg2(j)) <> "" Then
Set C = Workbooks(Arg1).Sheets("Feuil1").Columns(Arg2(j + ((UBound(Arg2) + 1) / 2))).Find(.Cells(i, Arg2(j)))
If Not C Is Nothing Then .Cells(i, Arg2(j)).EntireRow.Delete
End If
Next
.Activate
End With
Next
End Sub
Sub Nettoyeur()
MyArray = Array("BddClient.xls", "BddProspect.xls", "BddSuspect.xls")
For i = 0 To UBound(MyArray)
Windows(MyArray(i)).Activate
Set D = ActiveSheet.Rows(1).Find("TEL")
If Not D Is Nothing Then Remplacement Range(Cells(2, D.Column), Cells(65536, D.Column).End(xlUp))
Set E = ActiveSheet.Rows(1).Find("TELECOPIE")
If Not E Is Nothing Then Remplacement Range(Cells(2, E.Column), Cells(65536, E.Column).End(xlUp))
Next
End Sub
Sub Remplacement(Arg1)
Arg1.Replace What:=",", Replacement:=""
Arg1.Replace What:="/", Replacement:=""
Arg1.Replace What:=".", Replacement:=""
Arg1.Replace What:=" ", Replacement:=""
Arg1.NumberFormat = "0#"" ""##"" ""##"" ""##"" ""##"
End Sub
Sub Recommencer()
With Workbooks("BddSuspect.xls")
.Sheets("Copie").Range("A1").CurrentRegion.Copy (.Sheets("Feuil1").Range("A1"))
End With
End Sub