![]() |
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 |
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) "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 |
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 |
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 . |
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 "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 |
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 |
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) "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 |
All times are GMT +1. The time now is 11:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com