Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Command to Right-Click Menu
I know how to add a macro to the right-click context menu, for example
to add the macro PasteVal: Sub CreateRightClick() With Application.CommandBars("Cell").Controls.Add .Caption = "Paste Values" .OnAction = "PasteVal" End With End Sub How would I add a conventional command to the right-click menu? Is it just a question of knowing the exact name of the command? I'm particularly interested in adding "Conditional Formatting..." to my right-click menu. TIA, Andy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Command to Right-Click Menu
Try the extended macros below:
Sub CreateRightClick() With Application.CommandBars("Cell").Controls.Add .Caption = "Conditional Formatting..." .OnAction = "show_cf" End With End Sub Private Sub show_cf() Application.Dialogs(xlDialogConditionalFormatting) .Show End Sub Regards, Edwin Tam http://www.vonixx.com On 1/11/05 1:01 PM, in article , "Andy" wrote: I know how to add a macro to the right-click context menu, for example to add the macro PasteVal: Sub CreateRightClick() With Application.CommandBars("Cell").Controls.Add .Caption = "Paste Values" .OnAction = "PasteVal" End With End Sub How would I add a conventional command to the right-click menu? Is it just a question of knowing the exact name of the command? I'm particularly interested in adding "Conditional Formatting..." to my right-click menu. TIA, Andy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Command to Right-Click Menu
Hi Andy,
Using Command's ID for Conditional formatting. Sub CreateRightClick() With Application.CommandBars("Cell").Controls .Add Type:=msoControlButton, _ ID:=3058, _ temporary:=True End With End Sub Regards, Shah Shailesh http://members.lycos.co.uk/shahweb/ *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Command to Right-Click Menu
That did it.
Thank you both, Edwin and Shailesh! Andy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ADD A COMMAND TO MOUSE RIGHT CLICK | Setting up and Configuration of Excel | |||
Name of Text-Box Right-Click Command Bar? | Excel Discussion (Misc queries) | |||
How to add a command button and on-click within vba | Excel Programming | |||
Adding a menu item right click menu when clicking on a single. | Excel Programming | |||
Adding menu to the mouse right click pop-up menu | Excel Programming |