Bonjour,
C'est "MatchEntry" dans "UserForm_Initialize" qui valide la saisie.
Option Explicit
Private Sub ComboBox1_Change()
Dim lLoc As Long
lLoc = Me.ComboBox1.ListIndex
'check for a valid entry
If lLoc = -1 Then
Me.ComboBox1.SetFocus
ComboBox1.ListIndex = -1
Exit Sub
End If
End Sub
Private Sub CommandButton1_Click()
If ComboBox1.ListIndex = -1 Then
Exit Sub
Else
Cells(1, 1) = ComboBox1.Value
ComboBox1.ListIndex = -1
End If
End Sub
Private Sub UserForm_Initialize()
Me.ComboBox1.MatchEntry = fmMatchEntryComplete
End Sub
ric