

If you use a small screen, some code lines may appear broken, but they will be okay when pasted. Just hightlight the code with the mouse, copy (CTRL+C) and paste (CTRL+V). To test the example below, copy the macros "CreateShortcut" and "Dummy1" to "Dummy7" into a standard module in VBA. However it is pratical to make the menu automatically, when the spreadsheet is opened - more about this later.

One, where you design the menu, and one that calls the menu, when you right-click.

It requires only two macros to make the popup menu appear. the value of a variable can determine the status of a menu item. It can be hidden, shown, disabled or enabled runtime dictated by circumstance, i.e. With VBA you can easily make a popup menu (shortcut menu) that pops up, when you right-click, and replaces Excel's built-in menu for right-click.Įach menu item can call a macro or a standard function in Excel. Make your own popup menu in Excel with VBA
