Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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
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
What is a shortcut menu? Jeffry Excel Discussion (Misc queries) 4 May 4th 09 04:03 PM
Popup Menu / Shortcut Menu Dale Fye Excel Discussion (Misc queries) 2 October 12th 07 12:57 AM
Shortcut menu help Art Excel Programming 14 August 16th 05 08:57 AM
shortcut menu Javed Excel Discussion (Misc queries) 1 December 6th 04 09:28 PM
shortcut for menu Douvid Excel Programming 1 July 28th 03 06:04 PM


All times are GMT +1. The time now is 04:24 AM.

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"