Option Explicit
Private Sub Workbook_Open()
'
Dim cmdBtn As CommandBarButton
'
Set cmdBtn = Application.CommandBars("Cell").Controls.Add(Temporary:=True, Before:=1, Type:=msoControlButton) ' Add a custom button option to the right-click context menu.
'
With cmdBtn
.Caption = "Paste Special Text" ' Caption for the added right click menu button
.FaceId = 755 ' Icon to display for the added right click menu button
.OnAction = "PasteSpecialText" ' Name of the code module that you want to run when the added right click option is selected
End With
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'
Application.CommandBars("Cell").Controls("Paste Special Text").Delete ' Delete the custom right click button when the workbook is closed.
End Sub