Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ListBox1.Visible = False
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
With ActiveCell
If .Row = 1 Or .Column < 8 Or Cells(.Row, 1) = "" Or Cells(1, .Column) = "" Then Exit Sub
End With
Cancel = True
Afficher
End Sub
Private Sub ListBox1_Change()
Dim montant#, L%
montant = 2 'modifiable
L = ListBox1.ListIndex
If L = -1 Then Exit Sub
ActiveCell = ActiveCell + IIf(L = 0, montant, IIf(L = 1, -montant, 0))
If ActiveCell < montant Then ActiveCell = ""
If L = 2 Then ListBox1.Visible = False: ActiveCell.Activate Else Application.OnTime 1, Me.CodeName & ".Afficher"
End Sub
Private Sub Afficher()
With ListBox1
.Top = ActiveCell.Top
.Left = ActiveCell(1, 2).Left
.ListIndex = -1
.Visible = True
End With
End Sub