![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Little Italy
Posts: 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? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Just use UserForm1.Show. You can refer to the controls on the userform, from outside it's module, by prefacing the control name with the userform name eg: -
UserForm1.TextBox1.Text = "" |
|
|
|
|
|
#3 | |
|
Board Regular
Join Date: Mar 2002
Location: Little Italy
Posts: 93
|
Quote:
|
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Little Italy
Posts: 93
|
Anyone? Please! Mudface? Cum on man, let me have it...
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Little Italy
Posts: 93
|
Is this really this hard? Cum on guys! Be a punch of pals and give it to me!
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Mar 2002
Location: Little Italy
Posts: 93
|
Any of you new guys got an idea?
|
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
UserForm1.Show has already been the exact VBA code to show a userform.
You can try. |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
|
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
A form is a class module...
The answer given seems to be right Use this syntax frmYourForm.Sub_Name This will load the form into memory but will not show it |
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Just to clarify dude.
You have a form called frmDude Contained within the forms code you have a sub called... Sub RunThisSub 'code End Sub To access this sub outside of the actual running form use this syntax frmDude.RunThisSub As I said before, this will load the form into memory but will not show it. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|