Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Left(TextBox1, 4) <> "CW1 " Then GoTo ErreurFormat
If Not IsNumeric(Right(TextBox1, 4)) Then GoTo ErreurFormat
If Len(TextBox1) <> 8 Then GoTo ErreurFormat
Exit Sub
ErreurFormat:
MsgBox "Format faux": TextBox1 = "": Cancel = True
End Sub
J'en profite pour poser une autre petite question:
J'ai dans un même Userform 2 ComboBox (ComboBox1 et ComboBox2) qui ont la même liste déroulante. Je souhaiterais que par défaut la ComboBox 2 affiche le choix sélectionné par l'utilisateur dans la ComboBox1. Je sais pas si je suis claire :S