How to open UserForm code by VBA?

Sbirro Cornuto

Board Regular
Joined
Mar 18, 2002
Messages
93
'Sup?
How can I open the UserForm code module by macro. Like when I use VBA to open some regular macro, you know with 'Application.Goto Reference:="the name of the Sub"'. This doesn't work if the Sub is in the UserForm. How should I name the Reference? Any ideas?
 
Are you talkin about opening a designers for in stand alone VB?

If so, export the file form VBA, and then double click it to open it in VB
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
On 2002-03-20 01:59, TsTom wrote:
Are you talkin about opening a designers for in stand alone VB?

If so, export the file form VBA, and then double click it to open it in VB

I believe he wants to open up the Actual code
in the VBA Editor...similar to hyperlinking
in Excel97 to a code module (Not poss in Ecel2000) OR Application.Goto [name of sub routine]
EXCEPT he wants to goto the Userform Code.

Not sure if you can ??
 
Upvote 0
I am totally lost, but here's a stab in the dark.


Sub OpenTheVBE()
Application.VBE.ActiveCodePane.Show
End Sub
 
Upvote 0
On 2002-03-20 02:22, Ivan F Moala wrote:

I believe he wants to open up the Actual code
in the VBA Editor...similar to hyperlinking
in Excel97 to a code module (Not poss in Ecel2000) OR Application.Goto [name of sub routine]
EXCEPT he wants to goto the Userform Code.

Not sure if you can ??

Thanks Ivan! You got the problem just right. That is indeed what I would like to be able to do, to open the actual code for editing in Excel VBE. I know that you can do it whit Goto Reference:= "Sub something" if the the Sub something() is just a regular Excel VBA module, but it gets tricky when the Sub something() is in UserForm code. There must be some way to do this, I just haven't figured it out yet. I believe the main issue here is how to name the Reference right. Think hard fellows...

Thx in advanz
 
Upvote 0
On 2002-03-21 14:19, Sbirro Cornuto wrote:
Any MVPs on line? Come on, shoot me with your wisdom...

Try this;

Sub GoTo_UserForm()
Set Application.VBE.ActiveCodePane = _
ThisWorkbook.VBProject.VBComponents("UserForm1").CodeModule.CodePane

Application.VBE.ActiveCodePane.Show

End Sub

Userform1 being the userform code to show


Ivan
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,724
Members
448,294
Latest member
jmjmjmjmjmjm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top