Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default sub executed as the form loads

It's quite a stupid question...
how do i get to run a sub as the form loads?

smth like

sub myform_initialize()
or
sub myform_load()

but it doesn't work...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default sub executed as the form loads

The initialize event is always named

Private Sub Userform_Initialize()

and you can use that to run your code. It is always best to enter event
declarations by selecting them from the dropdowns at the top of the module.
Then you wouldn't have tried to use a name like myfornm_initialize().
There is no Load event - that is what initialize is.


There is an Activate event.
--
Regards,
Tom Ogilvy

"snaggy^^" wrote in message
...
It's quite a stupid question...
how do i get to run a sub as the form loads?

smth like

sub myform_initialize()
or
sub myform_load()

but it doesn't work...



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
Macro get executed twice Anand Nichkaode Excel Discussion (Misc queries) 3 September 24th 08 01:25 PM
part of a code not being executed Valeria Excel Programming 2 September 28th 05 07:55 AM
No file when Save As is executed D.Parker Excel Programming 7 April 2nd 05 12:46 AM
No file when Save As is executed Dave Peterson[_5_] Excel Programming 1 March 30th 05 07:02 PM
Beginner question: where to put code when form loads TBA[_2_] Excel Programming 4 August 31st 03 09:28 PM


All times are GMT +1. The time now is 12:05 PM.

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

About Us

"It's about Microsoft Excel"