Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple Userform Macro Headache

Hello all,

This is my first time posting to this group, so I'm sorry if I
(unintentionally) don't follow proper conventions.

My problem is with creating a macro that utilizes multiple userforms.
Of course, this means that each userform has its own name, own code,
etc. The problem lies with the Userform_Initialize() event. If I use
this code:

PartsFindForm.Show 'where PartsFindForm is the name of the userform

Userform_Initialize() gives me an error and Excel refuses to run until
I change the name to PartsFindForm_Initialize(). Of course, Excel then
no longer recognizes this as an event and skips any code inside the
Sub. What should I do to make this work? As of now I am running
everything with the Userform_Activate() event which works perfectly
(like Initialize() should) with the problem that code that I only want
running once gets run multiple times. This error also occurs with Load,
Hide, and any other Userform specific commands.

Any help would be greatly appreciated! Thank you.

-Larry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Multiple Userform Macro Headache

renaming initialize just causes it not to fire, so there is nothing magic
there.

It sounds like you have a duplicate name defined somewhere. Maybe you named
a variable userform or named a procedure Userform.

You may need to find this problem and change it, then rebuild your project
use Rob Bovey's free code cleaner utility
http://www.appspro.com - goto downloads

--
Regards,
Tom Ogilvy


" wrote:

Hello all,

This is my first time posting to this group, so I'm sorry if I
(unintentionally) don't follow proper conventions.

My problem is with creating a macro that utilizes multiple userforms.
Of course, this means that each userform has its own name, own code,
etc. The problem lies with the Userform_Initialize() event. If I use
this code:

PartsFindForm.Show 'where PartsFindForm is the name of the userform

Userform_Initialize() gives me an error and Excel refuses to run until
I change the name to PartsFindForm_Initialize(). Of course, Excel then
no longer recognizes this as an event and skips any code inside the
Sub. What should I do to make this work? As of now I am running
everything with the Userform_Activate() event which works perfectly
(like Initialize() should) with the problem that code that I only want
running once gets run multiple times. This error also occurs with Load,
Hide, and any other Userform specific commands.

Any help would be greatly appreciated! Thank you.

-Larry


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
Transposing + Absolute Reference + Multiple Worksheets = my headache londar Excel Worksheet Functions 4 March 30th 06 07:22 PM
headache! :) unique_id's cjjoo Excel Worksheet Functions 7 October 21st 05 03:24 AM
IF formula headache Puggwash Excel Programming 3 October 11th 04 01:19 PM
AND Headache (with dates)! Alan L. Wagoner Excel Programming 2 February 19th 04 03:41 PM
Look up Headache Chris Excel Programming 3 November 26th 03 02:55 PM


All times are GMT +1. The time now is 01:58 AM.

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"