A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

customize context menu



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2004, 01:11 AM
Andy
external usenet poster
 
Posts: n/a
Default customize context menu

I know how easy it is to customize toolbars and menu bars but that seems
to exclude the "right click" context menu. How can I do that?
I want to add a summation command and a data sort command, I use them a lot.

  #2  
Old March 25th, 2004, 01:44 AM
Gord Dibben
external usenet poster
 
Posts: n/a
Default customize context menu

Andy

Done through VBA code. In the ThisWorkbook module.

Private Sub WorkBook_Open()
With Application.CommandBars("Cell").Controls.Add(tempo rary:=True)
.Caption = "Change Text Case"
.OnAction = "MyMacros.xla" & "!Chg_Case"
End With
End Sub

To clear the menu when you close. Otherwise you get duplicates.

Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Cell").Controls("Change Text Case").Delete
End Sub

Place this code in your Personal.xls or in my case, the MyMacros add-in.

Gord Dibben Excel MVP

On Wed, 24 Mar 2004 17:11:23 -0800, Andy wrote:

I know how easy it is to customize toolbars and menu bars but that seems
to exclude the "right click" context menu. How can I do that?
I want to add a summation command and a data sort command, I use them a lot.


  #3  
Old March 25th, 2004, 05:17 PM
David McRitchie
external usenet poster
 
Posts: n/a
Default customize context menu

Hi Andy,
You specifically asked for AutoSum -- don't know what the fascination is
about AutoSum on right click menus is but see this previous posting:
http://google.com/groups?threadm=ujk...gp13.phx .gbl

I won't touch the sort part of your question, as I can't think of anything that
would be generic work in a wide range of situations and not mess up
data if used accidentally. At least not without particulars on exactly
what you want and why a right-click menu. Some help on using sort
http://www.mvps.org/dmcritchie/excel/sorting.htm#ctrla
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:30 PM.


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