Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Open VBA Editor?

Hi,

Is there a way I can open the vba editor from a command button?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Open VBA Editor?

Hi Craig,

Do you mean with a button in the QAT (Quick Access Toolbar)? If so, right
click the blank space at end of QAT - Customize Quick Access Toolbar - In
the Choose commands from select All commands. Find Visual Basic and Add it.

--
Regards,

OssieMac


"Craig" wrote:

Hi,

Is there a way I can open the vba editor from a command button?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Open VBA Editor?

apologies if i was not clear....i am trying to assist colleagues in writing
simple code. From a Userform i have done i want to include a button that when
clicked will take the user straight to 'view code' so they can input examples
of code i have prepared for them....trying to get more people to see how
useful vba can be!!!!!!

"OssieMac" wrote:

Hi Craig,

Do you mean with a button in the QAT (Quick Access Toolbar)? If so, right
click the blank space at end of QAT - Customize Quick Access Toolbar - In
the Choose commands from select All commands. Find Visual Basic and Add it.

--
Regards,

OssieMac


"Craig" wrote:

Hi,

Is there a way I can open the vba editor from a command button?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Open VBA Editor?

Try a procedure like

Sub GotoVBA(Optional ModuleName As String)
Application.VBE.MainWindow.Visible = True

ThisWorkbook.VBProject.VBComponents(ModuleName).Co deModule.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
wrote:

Hi,

Is there a way I can open the vba editor from a command button?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Open VBA Editor?

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" wrote in message
...
Hi,

Is there a way I can open the vba editor from a command button?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Open VBA Editor?

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@discussions wrote in message
...
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" wrote in message
...
Hi,

Is there a way I can open the vba editor from a command button?





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Open VBA Editor?

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).Co deModule.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
wrote:

Hi,

Is there a way I can open the vba editor from a command button?

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatically Halt Macro and Open VB Editor ron Excel Programming 2 March 14th 08 03:34 PM
Hyperlink .jpg now open in IE not Photo Editor like before IE upgr Jason Excel Discussion (Misc queries) 0 January 7th 07 01:09 AM
Don't open vb editor John Vickers Excel Discussion (Misc queries) 1 February 17th 06 04:47 AM
Q: Open VB - Editor from macro...? Andrew Excel Programming 3 September 25th 05 07:31 PM
Programmatically open / edit vba-editor hglamy[_2_] Excel Programming 1 September 4th 03 03:32 PM


All times are GMT +1. The time now is 05:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"