Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel As Boolean)
Dim cmb0, cmb1, cmb2 As CommandBarControl
For Each cmb0 In Application.CommandBars("cell").Controls
cmb0.Delete
Next
Set cmb1 = Application.CommandBars("cell").Controls.Add(Type:=msoControlButton)
Set cmb2 = Application.CommandBars("cell").Controls.Add(Type:=msoControlButton)
With cmb1
.Caption = "修改"
.FaceId = 7
.OnAction = "Data_Amend"
End With
With cmb2
.Caption = "删除"
.FaceId = 21
.OnAction = "Data_Delete"
End With
End Sub 恢复右键
Application.CommandBars("cell").Reset |