Bonjour tout le monde,
Dans le code d'archer, il y a 2 points qui me semblent à revoir :
1. Ces 2 lignes ont le même effet :
Cel = Trim(Cel)
Cel = Application.Substitute(Cel, " ", "")
2. Cette instruction supprimera tout les 33, pas seulement ceux en début de numéro (exemple : 01 23 33 45 67 devient 01 23 0 45 67) :
Cel = Application.Substitute(Cel, "33", "0")
Je propose donc de corriger par :
Private Sub CommandButton1_Click()
Dim Cel As Range, DerLig As Long, Lig As Long
Application.ScreenUpdating = False
DerLig = Range("K" & Rows.Count).End(xlUp).Row
For Lig = DerLig To 1 Step -1
Set Cel = Range("K" & Lig)
Cel = Replace(Cel, "O", "0")
Cel = Replace(Cel, ".", "") 'supprime les "." (points)
Cel = Replace(Cel, " ", "") 'supprime les espaces
Cel = CLng(Right(Cel, 9)) 'Ne garde que les 9 derniers caractères (pas de +33, 33 ni 0)
Cel.NumberFormat = "0# ## ## ## ##" 'formate en N° Tel
If Cel < 10 Then Cel.EntireRow.Delete
Next Lig
End Sub
PS : ce code gère aussi le changement de dimension de ta plage (voir instruction "DerLig = ...")