Removing Items from a Context Menu

Written by Allen Wyatt (last updated September 29, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


3

Don likes to use the Context menus that appear when he right-clicks on a cell. Once the Context menu is visible, he can press a shortcut key of whichever command he wants to perform. (The shortcut key is the underlined letter for each option on the Context menu.) The problem is that the Context menu has two items that use the same shortcut key: Copy and Create List. Since he never uses the Create List option, Don would love to get rid of it completely, so that only the Copy command is initiated by the C shortcut key.

The only way to change the Context menus is through a macro. The code to perform such a change is identical to the code used for other menus or command bars. There is a huge discussion (much too big for this tip) on how to make these types of changes in the Microsoft Knowledge Base, at this address:

http://support.microsoft.com/kb/830502

Additional information, specific to Context menus (what Microsoft confusingly calls Shortcut menus), can be found in this Knowledge Base article:

http://support.microsoft.com/kb/213209

While there is a wealth of information in these two articles, the actual code to modify the Context menu that appears when you right-click a cell is relatively simple. In fact, it can be boiled down to a single-line macro:

Sub RemoveCreateList()
    Application.CommandBars("Cell").Controls("Create List...").Delete
End Sub

Run the macro, and the Create List item is gone. You could remove any other item from the menu by simply replacing the "Create List..." text with the exact wording of the menu item you want to remove. When you later want to restore the menu, you run another single-line macro to reset it:

Sub ResetMenu()
    Application.CommandBars("Cell").Reset
End Sub

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3089) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Word Link to Create a New Excel Workbook

It's easy to create and include links in your documents to other sources, in and out of Word. There are some limitations ...

Discover More

Turning Off Automatic Capitalization in Lists

By default, Word capitalizes letters that it thinks designate the beginning of a sentence. This includes at the beginning ...

Discover More

Automatically Changing a Cell's Background Color

It is often desired to change what is displayed in a cell based on what is in a different cell. What if what you want to ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Resetting Excel Menus

Excel allows you to easily change what appears on its menus. If you later want to return to Excel's default menu ...

Discover More

Deleting Menu Items

Excel allows you to customize your menus so that they contain the commands you want on them. If you later want to delete ...

Discover More

Problem with Missing Context Menu Option

When you right-click a cell, does it seem that the Context menu is missing an item or two? Here's how to get those items ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 8?

2018-08-27 09:28:49

Rodger Abrahams

Hi there, I have two excel files in Excel 2013. When I right click in the one file I get a context menu with "Exclude From Print Area" in it [3rd from the bottom] but when I right click on the other Excel file the context menu does not have the option "Exclude From Print Area". Why is this different between the two files.


2017-09-23 16:20:06

Eric

Thanks for this tip! It worked like a charm to get rid of some annoying options a 3rd-party Excel Add-In added on install, but didn't add on delete.


2016-04-08 16:48:24

Stan Z

Allen, This remove context from menu tip is almost what I was looking but would want the ability to add custom ribbon features similar to the copy clipboard and then pin useful ones. Ideally, The shortcut ribbon is useful to put frequently used features easy to access. Is there an app/ feature to make a custome excel ribbon available during right clicks? Thanks for your time.
R,
Stan


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.