Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
add to shortcut menu
i am trying to make a custom shortcut menu for when any cell in the
activesheet is clicked, but i am not entirely sure how to do this. this is what i have so far to change the font: Sub FormatFontShow() Application.Dialogs(xlDialogFormatFont).Show End Sub but i don't know how to make a new shortcut menu with this item when you right click on any cell. TIA. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
add to shortcut menu
Hi
as starting point some code: Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "Now you code yould start" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Spencer Hutton wrote: i am trying to make a custom shortcut menu for when any cell in the activesheet is clicked, but i am not entirely sure how to do this. this is what i have so far to change the font: Sub FormatFontShow() Application.Dialogs(xlDialogFormatFont).Show End Sub but i don't know how to make a new shortcut menu with this item when you right click on any cell. TIA. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
add to shortcut menu
my mistake, i meant when a cell is Right Clicked.
"Frank Kabel" wrote in message ... Hi as starting point some code: Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "Now you code yould start" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Spencer Hutton wrote: i am trying to make a custom shortcut menu for when any cell in the activesheet is clicked, but i am not entirely sure how to do this. this is what i have so far to change the font: Sub FormatFontShow() Application.Dialogs(xlDialogFormatFont).Show End Sub but i don't know how to make a new shortcut menu with this item when you right click on any cell. TIA. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
add to shortcut menu
Hi
this is just what the code is for :-) -- Regards Frank Kabel Frankfurt, Germany Spencer Hutton wrote: my mistake, i meant when a cell is Right Clicked. "Frank Kabel" wrote in message ... Hi as starting point some code: Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "Now you code yould start" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Spencer Hutton wrote: i am trying to make a custom shortcut menu for when any cell in the activesheet is clicked, but i am not entirely sure how to do this. this is what i have so far to change the font: Sub FormatFontShow() Application.Dialogs(xlDialogFormatFont).Show End Sub but i don't know how to make a new shortcut menu with this item when you right click on any cell. TIA. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What is a shortcut menu? | Excel Discussion (Misc queries) | |||
Popup Menu / Shortcut Menu | Excel Discussion (Misc queries) | |||
Shortcut menu help | Excel Programming | |||
shortcut menu | Excel Discussion (Misc queries) | |||
shortcut for menu | Excel Programming |