Sub Table_RightClick()
Dim Cbar As CommandBarControl
Const Cb = "RightClick"
' Pour fournir les option de suppression et d'insertion de table en priorité
' quand on fait un clic droit sur un Tableau Structuré
On Error Resume Next: CommandBars(Cb).Delete: On Error GoTo 0
With CommandBars.Add(Cb, msoBarPopup, , True)
If ActiveSheet.Name = [Tableau_Stock_Congel].Parent.Name Then
With .Controls.Add(msoControlButton, , , , True)
.Caption = "Transfert vers Petite_Congel"
.FaceId = 1263
.OnAction = "Table_Transfert"
End With
End If
If ActiveSheet.Name = [Tableau_Petite_Congel].Parent.Name _
Or ActiveSheet.Name = [Tableau_Stock_Congel].Parent.Name Then
With .Controls.Add(msoControlButton, , , , True)
.Caption = "Sortie"
.FaceId = 3634 '47
.OnAction = "Table_Sortie"
End With
End If
.Controls.Add msoControlButton, 7374, , , True
.Controls.Add msoControlButton, 7373, , , True
' On recopie les controles standards du double_clic sur Cellule
' .Controls.Add(msoControlButton, , , , True).BeginGroup = True
' For Each Cbar In CommandBars("Cell").Controls
' Cbar.Copy CommandBars(Cb)
' Next
.ShowPopup
.Delete
End With
End Sub