Sub suppression_doublons()
vchrono = Now()
Dim B As String
B = InputBox("Quelle est la colonne pour supprimer les 3?")
If B = "" Then
'MsgBox "annulé"
Exit Sub
Else
End If
Dim C As String
C = InputBox("Quelle est la colonne pour supprimer les doublons?")
If C = "" Then
MsgBox "annulé"
Exit Sub
Else
End If
Dim z As Long
Partir du bas du tableau
For z = Range(B & Rows.Count).End(xlUp).Row To 2 Step -1
If Range(B & z) = "3" Then Range(B & z).EntireRow.Delete xlShiftUp
Next z
Dim i&, l&, t()
With Feuil1.Columns(C & ":" & C)
l = .Cells(.Rows.Count).End(xlUp).Row
t = Range(.Cells(1), .Cells(l)).Value
With Application: .ScreenUpdating = 0: .EnableEvents = 0: .Calculation = -4135: End With
For i = l To 3 Step -1
If Not IsEmpty(t(i, 1)) Then If AscW(t(i, 1)) <> 9658 And IsEmpty(t(i - 1, 1)) Then .Cells(i).Value = Chr(33) & .Cells(i).Value: i = i - 1: .Parent.Rows(i).Delete
Next
With Application: .Calculation = -4105: .EnableEvents = 1: .ScreenUpdating = 1: End With
End With
Cells.Replace What:="!", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
vchrono = Now() - vchrono
MsgBox Format(vchrono, "h:mm:ss")
MsgBox ("traitement terminé")
End Sub