Private Sub TextBox1_Change()
Dim i As Integer, h As Integer, Chaine As String, Compteur As Integer
Dim Obj As Object
Set Obj = TextBox1
Chaine = Obj.Value
For i = 1 To Len(Obj.Value)
Compteur = 0
If Mid(Chaine, i, 1) = "-" Then
For h = i To Len(Obj.Value)
If Mid(Chaine, h, 1) = "-" Then
Compteur = Compteur + 1
Else
Exit For
End If
Next h
Chaine = Mid(Chaine, 1, i) & Mid(Chaine, i + Compteur, Len(Chaine))
End If
Next i
Application.EnableEvents = False
Obj.Value = Chaine
Application.EnableEvents = True
End Sub