'si on tape sur les touches numeriques la liste se reduit aux occurences du même LEFT que le VALUE
Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim s&, txt$
With ComboBox1
Select Case (KeyCode)
Case 96 To 105, 48 To 57 ' ici c'est les touches de 0 à 9
If KeyCode < 96 Then KeyCode = KeyCode + 48
Select Case Len(.Value): Case 2, 5, 8, 11: .Value = .Value & " ": End Select
.Value = .Value & Chr(KeyCode - 48)
Select Case Len(.Value): Case 2, 5, 8, 11: .Value = .Value & " ": End Select
txt = .Text
partListe
KeyCode = 0
tbxligne = ""
.DropDown
If .ListCount = 0 Then
.Text = Left(.Text, Len(.Text) - 1)
MsgBox txt & vbCrLf & "Aucune occurence disponnible" & vbCrLf & "pour ce début de numéro": .SetFocus
End If
Case 8
'If .ListCount = 1 Then .Value = ""
If Right(.Value, 1) = " " Then s = 2 Else s = 1
If .Value <> "" Then .Value = Left(.Value, Len(.Text) - s): partListe Else .List = tbl
KeyCode = 0
tbxligne = ""
If .Value = "" Then Textbox1.SetFocus: .SetFocus
Case 46
.Value = ""
partListe
Case Else: KeyCode = 0
End Select
End With
End Sub