Add "paste values" to right-click shortcut menu-how do?

C

Chet

Anyone know how to add "paste values" to the shortcut menu that comes
up when you right-click over a worksheet? John Walkenbach refers to
it in his book Power Programming Techniques 5 but I am missing some
details on how to do this. Thanks, Chet
 
B

Bernie Deitrick

Chet,

For all but XL 2007, code from Ron deBruin:

Sub Add_Paste_Special_Button()
' This will add the Paste Special Values button to the cell menu
' after the Paste option
Dim Num As Long
Num = Application.CommandBars("Cell"). _
FindControl(ID:=755).Index
Application.CommandBars("cell").Controls. _
Add Type:=msoControlButton, ID:=370, before:=Num
End Sub

Sub Delete_Paste_Special_Button()
On Error Resume Next
Application.CommandBars("cell").FindControl(ID:=370).Delete
On Error GoTo 0
End Sub


HTH,
Bernie
MS Excel MVP
 
C

Chet

That is wonderful... one more question. Where might I put this code
so that it will run every time I start Excel?...
Best regards,
Chet
 
B

Bernie Deitrick

You only need to run it once. When you close Excel, your .xlb file will store your modification.

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top