Try a procedure like
Sub GotoVBA(Optional ModuleName As String)
Application.VBE.MainWindow.Visible = True
ThisWorkbook.VBProject.VBComponents(ModuleName).CodeModule.CodePane.Show
End Sub
ModuleName is the name of the module that you want to activate when
the VBA editor's main window is opened. E.g/.
Sub AA()
GotoVBA "MyCodeModule"
End Sub
Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com