'Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'AppliquerMacro
'End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim Zone_Saisie As Range
Dim Valeurs() As Variant
Dim Shp As Shape
Set Zone_Saisie = ActiveSheet.Range("B3:AF15")
On Error Resume Next
Application.CommandBars("Cell").Enabled = False
Valeurs = Array("A", "B", "C", "D", "E", "F")
If Not Intersect(Target, Zone_Saisie) Is Nothing Then
'lignes inutiles effacées
Select Case NbClic
Case 0 To 5
Set c = ActiveCell
For Each Shp In ActiveSheet.Shapes
If Shp.TopLeftCell.Cells(2, 2).Address = Target.Address Then Shp.Delete
Next
Set Shp = ActiveSheet.Shapes.AddShape _
(msoShapeRectangle, c.Left, c.Top, c.Width, c.Height)
With Shp.TextFrame
.Characters.Text = Valeurs(NbClic)
With .Characters.Font
.Bold = True
.Size = 8.5
.ColorIndex = 3
.Superscript = True
End With
.HorizontalAlignment = xlRight
.VerticalAlignment = xlCenter
.Orientation = xlHorizontal
.AutoSize = False
End With
Shp.Line.Visible = msoFalse
Shp.Fill.Visible = msoFalse
End Select
End If
NbClic = NbClic + 1
If NbClic > 5 Then NbClic = 0
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
NbClic = 0: AppliquerMacro
End Sub