|
|
|
Author |
Message |
bobalooza
|
Posted: Tue Jan 13 17:19:14 CST 2004 |
Top |
Excel Programming >> UserForm Activation
When showing a UserForm, I tried to use this code:
Private Sub UserForm1_Activate()
MsgBox "hello"
Place code here that or call another sub rotine from here
End Sub
The UserForm opens up, but the Msgbox does not appear. What am I doing wrong? Thank you.
Doug
Excel522
|
|
|
|
|
Bob
|
Posted: Tue Jan 13 17:19:14 CST 2004 |
Top |
Excel Programming >> UserForm Activation
Have you put the code in the userform code module (not a normal code
module)?
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
> When showing a UserForm, I tried to use this code:
>
> Private Sub UserForm1_Activate()
> MsgBox "hello"
> Place code here that or call another sub rotine from here
> End Sub
>
> The UserForm opens up, but the Msgbox does not appear. What am I doing
wrong? Thank you.
>
> Doug
|
|
|
|
|
anonymous
|
Posted: Tue Jan 13 17:41:16 CST 2004 |
Top |
Excel Programming >> UserForm Activation
Bob,
No. Do I have to rename the Module to be the same name as the UserForm? Can you direct me to a link where I might be able to read up on this a little? Sorry to be such a dunce. I am trying to learn this as I go along, which is not always the best way. Thank you.
DOug
|
|
|
|
|
AussieOwl
|
Posted: Tue Jan 13 18:27:40 CST 2004 |
Top |
Excel Programming >> UserForm Activation
Try adding brackets ie:
MsgBox ("text")
>-----Original Message-----
>Bob,
>
>No. Do I have to rename the Module to be the same name
as the UserForm? Can you direct me to a link where I
might be able to read up on this a little? Sorry to be
such a dunce. I am trying to learn this as I go along,
which is not always the best way. Thank you.
>
>DOug
>.
>
|
|
|
|
|
Chip
|
Posted: Tue Jan 13 18:41:06 CST 2004 |
Top |
Excel Programming >> UserForm Activation
Doug,
You don't put this code in standard code modules. It goes in the
code module associated with the user form. Right-click the form
and choose View Code. Place the code in that module.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
> Bob,
>
> No. Do I have to rename the Module to be the same name as the
UserForm? Can you direct me to a link where I might be able to
read up on this a little? Sorry to be such a dunce. I am trying
to learn this as I go along, which is not always the best way.
Thank you.
>
> DOug
|
|
|
|
|
anonymous
|
Posted: Wed Jan 14 00:01:15 CST 2004 |
Top |
Excel Programming >> UserForm Activation
Chip,
Thank you. I now understand what you mean. But the code goes in the Activate section that gets called when the userform first opens up, correct?
Thanks.
Doug
|
|
|
|
|
Bob
|
Posted: Wed Jan 14 03:36:46 CST 2004 |
Top |
Excel Programming >> UserForm Activation
Doug,
Yes that is one place it can go.
It can be put in the Initialize section that is invoked when the for is
loaded into memory, the Activate section when the form is displayed, or it
could be driven by any number of other events, such as clicking a button.
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
> Chip,
>
> Thank you. I now understand what you mean. But the code goes in the
Activate section that gets called when the userform first opens up, correct?
>
> Thanks.
>
> Doug
|
|
|
|
|
|
|