Option Explicit
Public Sub New_Commandbar()
Dim Cbr As CommandBar
Dim Ctr As CommandBarControl
On Error Resume Next
Application.CommandBars("PivotTable Context Menu").Delete
Application.CommandBars.Add Name:="PivotTable Context Menu", Position:=msoBarPopup, Temporary:=True
For Each Ctr In Application.CommandBars("PivotTable Context Menu").Controls
With Application.CommandBars("PivotTable Context Menu").Controls.Add(Ctr.Type, Ctr.ID, Ctr.Parameter, , 1)
If (Ctr.Caption <> "Show field list") Or (Ctr.Caption <> "Show Values As...") Then
Else
Ctr.Delete
End If
End With
Next
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
New_Commandbar
Application.CommandBars("PivotTable Context Menu").Show
End Sub