Like respecte la casse :y a t'il une possibilité de faire respecter la casse du mot à rechercher.
Sub Suppr_mp3()
Dim c As Range
Application.ScreenUpdating = False
With ActiveSheet.UsedRange
For Each c In .Cells
If c Like "*mp3*" Then c = "#N/A"
Next
If Application.CountIf(.Cells, "#N/A") Then .Cells.SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete
End With
End Sub
Sub Suppr_mp3()
Dim c As Range
Application.ScreenUpdating = False
With ActiveSheet.UsedRange
For Each c In .Cells
If InStr(1, c, "mp3", vbBinaryCompare) > 0 Then c = "#N/A" ' la casse est respecté "MP3" en majuscule ne sera pas remplacé
Next
If Application.CountIf(.Cells, "#N/A") Then .Cells.SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete
End With
End Sub
Sub Suppr_mp3()
Cells.Replace "*mp3*", "#N/A", MatchCase:=True
If Application.CountIf(Cells, "#N/A") Then Cells.SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete
End Sub
mp3',MP3
Sub test()
For Each cel In [A1:A10].Cells
If cel Like "*[']*" Then Debug.Print "avec apostrophe " & cel.Address(0, 0) & " " & cel.Value
If cel Like "*[,]*" Then Debug.Print "avec virgule " & cel.Address(0, 0) & " " & cel.Value
If cel Like "*mp3[,|']MP3*" Then Debug.Print "mp3 min maj " & cel.Address(0, 0) & " " & cel.Value
Next
End Sub
Sub Suppr_mp3_MP3()
Dim c As Range, sup As Range
For Each c In ActiveSheet.UsedRange
If c Like "*mp3',MP3*" Then Set sup = Union(IIf(sup Is Nothing, c.EntireRow, sup), c.EntireRow)
Next
If Not sup Is Nothing Then sup.Delete
End Sub
Sub Suppr_mp3_MP3()
Dim c As Range, sup As Range
For Each c In ActiveSheet.UsedRange
If LCase(c) Like "*mp3*" Then Set sup = Union(IIf(sup Is Nothing, c.EntireRow, sup), c.EntireRow)
Next
If Not sup Is Nothing Then sup.Delete
End Sub
Sub Suppr_mp3_fonctionne_pas()
Cells.Replace "*mp3*", "#N/A", MatchCase:=True
If Application.CountIf(Cells, "#N/A") Then Cells.SpecialCells(xlCellTypeConstants, 16).EntireRow.Delete
End Sub
Sub Suppr_mp3_fonctionne()
Cells.Replace "*mp3*", "#N/A", MatchCase:=True
If Application.CountIf(Cells, "#N/A") Then Intersect(Cells, Cells.SpecialCells(xlCellTypeConstants, 16).EntireRow).Delete
End Sub
Sub RAZ()
[C4] = "mp3"
[E4] = "xxxmp3"
[G4] = "yyymp3zzz"
End Sub