Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) "Doug" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Doug" wrote in 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) "Doug" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
activation key | Excel Discussion (Misc queries) | |||
Activation Request | Excel Discussion (Misc queries) | |||
Sheet activation | Excel Discussion (Misc queries) | |||
program activation | Excel Programming | |||
Ctl-X activation of macros | Excel Programming |