Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Add "paste values" to right-click shortcut menu-how do? Excel 2010

I had a post about a year ago on how to do this but I am trying to
find out how to do it with Excel 2010 since this code below was said
to work up to version 2003. So does anyone know how to do it for
Excel 2010?

Original post-----
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


Response post---------
Bernie Deitrick
--------------------------------------
(1 user) More options Sep 18 2009, 8:15 am
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, befo=Num
End Sub
Sub Delete_Paste_Special_Button()
On Error Resume Next
Application.CommandBars("cell").FindControl(ID:=37 0).Delete
On Error GoTo 0
End Sub
HTH,
Bernie
MS Excel MVP
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Add "paste values" to right-click shortcut menu-how do? Excel 2010

Hi Chet


Sub RightClickPasteValues()
With Application.CommandBars("Cell")
..Reset
..Controls.Add Type:=msoControlButton, ID:=2950, Befo=.Controls.Count + 1
..Controls(.Controls.Count).Caption = "Paste Values"
..Controls(.Controls.Count).FaceId = 156
..Controls(.Controls.Count).OnAction = ThisWorkbook.Name &
"!formulapastevalues"
..Controls(.Controls.Count).BeginGroup = True
End With
End Sub

Sub formulapastevalues()
On error resume next
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End Sub


Regards
William


"Chet" wrote in message
...
I had a post about a year ago on how to do this but I am trying to
find out how to do it with Excel 2010 since this code below was said
to work up to version 2003. So does anyone know how to do it for
Excel 2010?

Original post-----
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


Response post---------
Bernie Deitrick
--------------------------------------
(1 user) More options Sep 18 2009, 8:15 am
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, befo=Num
End Sub
Sub Delete_Paste_Special_Button()
On Error Resume Next
Application.CommandBars("cell").FindControl(ID:=37 0).Delete
On Error GoTo 0
End Sub
HTH,
Bernie
MS Excel MVP


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add "paste values" to right-click shortcut menu-how do? Chet Excel Programming 4 September 18th 09 05:24 PM
How do I set my "Insert" key as a paste command shortcut in Excel Andrew Ball Excel Discussion (Misc queries) 7 June 20th 08 12:00 PM
add "paste values" to right click menu rockhammer Excel Programming 5 December 12th 07 01:01 AM
Shortcut key for "Paste Options" and "Error Checking" buttons? johndog Excel Discussion (Misc queries) 1 October 6th 06 11:56 AM
VBA to disable "Delete...." on shortcut menu of worksheet tab? Mary Kathryn Excel Discussion (Misc queries) 3 March 3rd 06 06:54 PM


All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"