VB:
	
	
	Private Sub TexVit_exit(ByVal cancel As MSForms.ReturnBoolean)
TexVit.Text = Format(TexVit.Text, "#""-""##""-""##""-""##""-""###""-""###")
        ActiveSheet.Range("H2").Select
     Do Until ActiveCell = Me.ComNom Or ActiveCell = ""
        ActiveCell.Offset(1, 0).Select
     Loop
        If ActiveCell = Me.ComNom.Value Then
        Else
    ActiveSheet.Range("N2").Select
    Do Until ActiveCell = Me.TexVit Or ActiveCell = ""
        ActiveCell.Offset(1, 0).Select
    Loop
    If ActiveCell = Me.TexVit.Value Then
       MsgBox " Le N° carte vitale   " & ActiveCell & "   Existe déjàdans la base"
       Me.TexVit = ""
       Me.TexVit.SetFocus
       Exit Sub
    End If
    End If
End Sub
	Dans cette macro je voudrais contrôler si il y a 18 caravctères (1-52-07-67-254-387) pour éviter les erreurs de frappe
Je vous remercie de votre aide