Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
activation key LewisT Excel Discussion (Misc queries) 2 March 24th 10 05:27 AM
Activation Request Harry Excel Discussion (Misc queries) 2 September 15th 07 05:22 AM
Sheet activation CWillis Excel Discussion (Misc queries) 5 June 1st 06 09:50 PM
program activation Lawson Excel Programming 2 October 30th 03 02:34 PM
Ctl-X activation of macros John Baker Excel Programming 1 October 17th 03 09:24 PM


All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"