From: Peter T on
Just noticed you want to do this from a button on a userform. Go with Chip
Pearson's suggestion. There might be an issue with other users if access to
vbProject is not trusted to call a specific codemodule. As an alternative
might be able to do could do
Application.Goto "myProcName"
Appactivate.Me.caption

Regards,
Peter T



"Peter T" <peter_t(a)discussions> wrote in message
news:OCIR5354KHA.620(a)TK2MSFTNGP02.phx.gbl...
>I assume you are aware of Alt-F11
>
> Another way - in the Name box left of the input bar, simply enter the name
> of a procedure that exists in any normal module. It doesn't need to be in
> the same project as the activeworkbook, could even be the name of a
> procedure in an addin.
>
> Regards,
> Peter T
>
> "Craig" <Craig(a)discussions.microsoft.com> wrote in message
> news:34BF8B88-6E69-408B-86E2-B66ECF1E951B(a)microsoft.com...
>> Hi,
>>
>> Is there a way I can open the vba editor from a command button?
>
>


From: Craig on
Chip & Pete T,

Many Thanks....used variatiions on the the theme and the trusted sources
ticked and got it working...brill.

Thanks Again

Craig

"Chip Pearson" wrote:

> 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
>
>
>
>
>
>
>
> On Fri, 23 Apr 2010 12:51:02 -0700, Craig
> <Craig(a)discussions.microsoft.com> wrote:
>
> >Hi,
> >
> >Is there a way I can open the vba editor from a command button?
> .
>