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
| Dim b()
_____________________________________________________________
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect([J4:j152], Target) Is Nothing And Target.Count = 1 Then
b = Sheets(F_Jou).Range("Joueurs").Value
Me.ComboBox2.List = b
Me.ComboBox2.Height = Target.Height + 3
Me.ComboBox2.Width = Target.Width + 17
Me.ComboBox2.Top = Target.Top
Me.ComboBox2.Left = Target.Left
Me.ComboBox2 = Target
Me.ComboBox2.Visible = True
Me.ComboBox2.Activate
'If Val(Application.Version) > 10 Then SendKeys "{esc}"
Me.ComboBox2.DropDown
Else
Me.ComboBox2.Visible = False
End If
End Sub
________________________________________________________________
Private Sub ComboBox2_Change()
ActiveCell.Value = Me.ComboBox2
End Sub
________________________________________________________________
Private Sub ComboBox2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Me.ComboBox2.List = b
Me.ComboBox2.Activate
Me.ComboBox2.DropDown
End Sub
________________________________________________________________
Private Sub ComboBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then ActiveCell.Offset(1).Select
End Sub |
Partager