1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Private Sub ComboBox1_KeyUp(ByVal keycode As MSForms.ReturnInteger, ByVal Shift As Integer)
mescombo_Change2 ComboBox1
End Sub
'
Private Sub ComboBox2_KeyUp(ByVal keycode As MSForms.ReturnInteger, ByVal Shift As Integer)
mescombo_Change2 ComboBox2
End Sub
'
'
Private Sub mescombo_Change2(combo As Object)
With combo
If Not .List(0) Like .Value & "*" And .ListIndex <= 0 Then
.Value = Left(.Value, Len(.Value) - 1)
Else
.DropDown ' a enlever apres observation
End If
End With
End Sub
'
Private Sub UserForm_Activate()
Me.ComboBox1.List = Array("pomme", "poire", "banane", "ananas", "raisin")
Me.ComboBox2.List = Array("pomme", "poire", "banane", "ananas", "raisin")
Me.ComboBox3.List = Array("pomme", "poire", "banane", "ananas", "raisin")
Me.ComboBox3.List = Array("pomme", "poire", "banane", "ananas", "raisin")
End Sub
'--------------------------------------------------------------------------------------------
' comparer les effet sur le texte avec l'utilisation de l'evenement change
'--------------------------------------------------------------------------------------------
Private Sub ComboBox3_Change()
mescombo_Change ComboBox3
End Sub
'
Private Sub ComboBox4_Change()
mescombo_Change ComboBox4
End Sub
Private Sub mescombo_Change(combo As Object)
With combo
If Not .List(0) Like .Value & "*" And .ListIndex <= 0 Then
.Value = Left(.Value, Len(.Value) - 1)
Else
.DropDown ' a enlever apres observation
End If
End With
End Sub |
Partager