![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 2
|
How can I customize the popup menu that comes up when you right click on any cell in a worksheet ?
|
|
|
|
|
|
#2 | |
|
Guest
Posts: n/a
|
Quote:
On Error GoTo 1 With Application.CommandBars("Cell") Do .Controls(1).Delete Loop 1: Set temp = .Controls.Add(msoControlButton) temp.Caption = "Test1" temp.OnAction = "Routine1" 'put routine1 in regular module Set temp = .Controls.Add(msoControlButton) temp.Caption = "Test2" temp.OnAction = "Routine2" 'put routine2 in regular module End With End Sub |
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
I tried this and now all that shows up is Test1 and Test2, where did the other buttons go?
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
Sorry to plagiarise Anonymous's code but try this. Just place the code in a standard module and run the macro. The two items will then be added to the shortcut menu.
Code:
Sub SetUpBar()
With Application.CommandBars("Cell")
Set temp = .Controls.Add(msoControlButton)
temp.Caption = "Test1"
temp.OnAction = "Routine1" 'put routine1 in regular module
Set temp = .Controls.Add(msoControlButton)
temp.Caption = "Test2"
temp.OnAction = "Routine2" 'put routine2 in regular module
End With
End Sub
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|