Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Event when a user form is loaded

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shashi1515 - 28 Mar 2006 18:30 GMT
I am using Excel 2000 and I want some event to triger whenever my user
form is loaded.

Ex: I have a user form with 6 edit boxes and I want to enable only few
edit boxes depending on the situation at which the user form is
called.

How should I capture the event the user form is loaded. Please help.

Thanks,
Shashi

Signature

shashi1515

Lonnie M. - 28 Mar 2006 18:52 GMT
Hi,
have the various procedures that initialize the form pass to your
userform initialize code something you can use to test it--something
like:
  'Public myTest as boolean
  If myTest1 = True then UserForm1.TextBox1.Enabled = True

HTH--Lonnie M.

> I am using Excel 2000 and I want some event to triger whenever my user
> form is loaded.
[quoted text clipped - 13 lines]
> shashi1515's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31109
> View this thread: http://www.excelforum.com/showthread.php?threadid=527224
Zack Barresse - 28 Mar 2006 18:54 GMT
Hi Shashi,

You can use the userform_initialize event in your userform code window ...

Private Sub Userform_Initialize()
   'your code here..
End Sub

HTH

Signature

Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM

> I am using Excel 2000 and I want some event to triger whenever my user
> form is loaded.
[quoted text clipped - 7 lines]
> Thanks,
> Shashi
Jim Thomlinson - 28 Mar 2006 18:58 GMT
The user for will have a couple of events that will do what you wnat. There
is initialize which is the code which runs the first time the userform is
loaded. The second event is activate which is the code that is run each time
the userform is loaded. Add these event to the uer form (select them from the
drop down menus in the code for the userform) and add a message box to them
something like this...

Private Sub UserForm_Activate()
   MsgBox "Activate"
End Sub

Private Sub UserForm_Initialize()
   MsgBox "Initialize"
End Sub
Signature

HTH...

Jim Thomlinson

> I am using Excel 2000 and I want some event to triger whenever my user
> form is loaded.
[quoted text clipped - 7 lines]
> Thanks,
> Shashi
shashi1515 - 28 Mar 2006 21:34 GMT
Thank you all for your replies. I got it.

Signature

shashi1515

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.