DIY Context Menu

I use 2 computers at work. One has Excel 2003, the other has Excel 2007. I’ve been using the one with 2003 longer and had a few macros stored in my Personal workbook. I was in the process of copying and pasting them into the other computer after sending them there by email. (Yeah, I know I can install both Excel versions in the same computer but this is how things turned out and I find it handy for testing)

Anyway, I wondered how I was going to call them. I had the macros in the 2003 computer assigned to toolbar buttons with icons but how about 2007? I could use the QAT but realized the face ids were going to be different. Not such a big problem, but I didn’t feel like going through the drama of selecting a whole lot of new ones, not to mention updating personal workbooks for both computers every time I added any new code. So I came up with the below right click menu addin that I use for both computers on a shared drive.

Just paste or write any macro into the addin and update the menu by pushing “Make Right Click Menu”, either in the VBE or right click menu itself to add and save. The module names in the addin act as sub menu names and the macro names get added as menu items. Numbers get added to act as keyboard shortcuts.

Also, there is some code to add spaces to module and macro names so that Private Sub DeleteAllFilesInFolder() in module MiscellaneousMacros would show in the menu as DIY Context Menu – Miscellaneous Macros – 1. Delete All Files In Folder

It’s a dynamic menu and a pretty simple one to use. Here is the download link if you want to try it. Some example macros are also included. I think it should work with Excel versions 97 – 2007.

Posted in Uncategorized

4 thoughts on “DIY Context Menu

  1. Great idea – I’m getting tired of Excel reassigning my macro toolbar buttons (this happens whenever Excel crashes and tries to recover Personal.xls – if anyone knows what I’m talking about, is there a way around this?).

    Now, Is there any way to make this context menu come up when you right-click on a chart object?

  2. Better late than never…

    In the RightClickMenu module, where it says ‘Add other right click menus here.

    Add “Chart”, “Series” etc as required.

    If you have JMT Excel Utilities installed, you can get a list of Excel’s right click menu items (Developer’s Tools, Show Excel Menu Details). If the menu type is “Popup” in Column E, refer to the menu item name in Column A.

    You can download the utilities here.
    http://www.andrewsexceltips.net/JMT%20Full%20List.htm


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.