Bonjour à tous,
C'est pas vraiment ce que voulait faire,
j'aurais souhaité supprimer la cellule directement dans la boucle (sans passer par un filtre)
Mais bon, çà marche !
Attention j'utilise la colonne A
Il n'y a pas d'en-têtes sur le fichier
Sub SupprEmail()
Dim Lgb&, Lgc&
Dim c As Range, Cel As Range
Dim firstAddress$, T
T = Time 'chrono
Application.ScreenUpdating = False
Application.CutCopyMode = False
Range("a1:b1").Insert Shift:=xlDown
Lgb = Range("b" & Rows.Count).End(xlUp).Row
Lgc = Range("c" & Rows.Count).End(xlUp).Row
For Each Cel In Range("c1:c" & Lgc)
With Columns("b")
Set c = .Find(Cel, LookIn:=xlValues, lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cells(c.Row, "a") = "x"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next Cel
'--- fltre ---
Range("g2") = "=a2=""x""" 'critère
Range("a1:b" & Lgb).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("g1:g2"), Unique:=False
Range("g2").ClearContents
'---
On Error Resume Next
Range("a2:b" & Lgb).SpecialCells(xlCellTypeVisible).Delete Shift:=xlUp
ActiveSheet.ShowAllData
Range("a1:b1").Delete Shift:=xlUp
Application.Goto Range("a1"), Scroll:=True
Set c = Nothing
MsgBox ("temps macro = " & Format(Time - T, "hh:mm:ss"))
End Sub
Tu nous diras le temps de traitement sur le fichier réel
Bonne journée
Claude