I think the question is clear. I want to set a macro in Excel 2007 which performs the following tasks.
(1) Right clicks on a particular cell, say A1.
(2) Chooses(left clicks) an option from the right click menu.
What I actually need is to assign this macro to a command button.
Best Answer
Go to VBA code editor (ALT+F11) and add new module (Insert->Module) then paste below code:
Now, double click on Sheet1 module and add this code:
That's all!
[EDIT]
You're able to call popup menu from commandbutton, this way:
For further information, please see:
Creating Popup Menus in All Versions of Excel
Customizing Context Menus in All Versions of Microsoft Excel