UserForms VBE and Class Modules...

M

MacGuy

I have a template that takes raw data (first row is header row and all
subsequent rows are data) and programatically creates a userform that the
user selects certain check boxes to do certain tasks - sort by this data
item, subtotal by this item, format data this way, breakout raw data into
tabs by this item, save by this item, etc. - and deletes the userform. The
user form has the raw data headers as rows and the check boxes as colums (raw
data column headers = user form rows in the first column) . Each column of
check boxes is named a certain way so they can be handled as selected;
example Col1_CheckBox_1 determines what field to sort.

The reason for the having the userform created this way is the raw data
fields change depending on what data is retrieved.

I have a class module that groups the userform check boxes and checks for
changes - some columns have only 1 check allowed, others more than 1.
Originally I had the user form created, used, and deleted in a single process
until it was determined limits need to be placed on certain tasks that need
to be performed. The class module code wasn't invoked at this time because
the code was still running and couldn't break away from the VBE process to
run the class module code.

As it is now the user selects the raw data file and the user form is
created. They then have to select another control to invoke the user form.
What I'm trying to get to, if possible, is to have this take place in one
step from the user's perspective. The user form is deleted on closing the
file.

Any ideas?
 
J

Joel

I would think yo ucould create an event in the regular module that will start
the class module. Then put in your regular module code a "DoEvents" which
will wait for the class module to complete. Finally put a show.userform in
your regular module to launch the userform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top