How to Switch from Worksheet to VBE Screen
I have a worksheet that has in column ?C? a list of all the macro names in the workbook. My objective is to be able to double click on a macro name, and it will take me to the VBE, which is now displaying the code of the macro whose name I double clicked on. Ideally it will work exactly as it does when you click on TOOLS->MACRO->MACROS, then click on the macro name that you want to go to in the VBE. To implement this, I created a ?WorkSheet_BeforeDoubleClick? event macro which does a little analysis, then calls the macro ?GoToMacroName?.
The macro ?GoToMacroName? contains one line:
Code:
Application.Goto Reference:=Selection.Value
This works like a charm, except the logic doesn?t switch me to the VBE window. When I manually open the VBE, then, voila!, the selected macro is there, just like I want it to be. So my question is, what VBA command do I write to switch me from my worksheet screen to the VBE screen?