Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ComboBox1
.Visible = False
If Intersect(ActiveCell, [J8:J31]) Is Nothing Then Exit Sub
.Left = ActiveCell.Left - .Width 'affichage à gauche de la cellule
.Top = ActiveCell.Top
.List = Array("RAPPELS", "NE PAS RAPPELER")
.Visible = True
Application.OnTime 1, Me.CodeName & ".Deroule"
End With
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(ActiveCell, [J8:J31]) Is Nothing Then Cancel = True: Worksheet_SelectionChange ActiveCell: Exit Sub
End Sub
Private Sub Combobox1_Change()
With ComboBox1
If .ListIndex = -1 Then .Text = "": Exit Sub
If .Text = "RAPPELS" Then
.List = [Rappels].Value
ElseIf .Text = "NE PAS RAPPELER" Then
.List = [Ne_pas_Rappeler].Value
Else
If .Text = "<effacer>" And ActiveCell <> "" Then
ActiveCell = Left(ActiveCell, Len(ActiveCell) - 1)
ActiveCell = Left(ActiveCell, InStrRev(ActiveCell, "-"))
.Visible = False
Else
ActiveCell = ActiveCell & " " & .Text & " -"
If IsError(Application.Match(.Text, [Rappels], 0)) Then
.Visible = False
Else
.List = [OKRappels].Value
End If
End If
End If
End With
ActiveCell.Activate
Application.OnTime 1, Me.CodeName & ".Deroule"
End Sub
Sub Deroule()
With ComboBox1
If .Visible Then .Text = "": .Activate: .DropDown 'déroule la liste
End With
End Sub