Passing a variable to UserForm_activate() event

B

Beertje

I am trying to use one userform for different macro's.
i.e.:
Private Sub UserForm_activate(macro)
If macro="modA" then
Call modA
Else
if macro ="modB"
Call modB
Else
Call modC
endif
Endif
End Sub

Is this possible? Please adise how to since I cannot get it to work.

Thanks.
 
B

Bob Phillips

What exactly are you trying to do, in words?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
B

Beertje

Hi Bob,
Project has 10 different macros, each takes about 2 - 5 minutes actual run
time.
I want to use the same progress bar for each macro.
Each macro is activated on one userform with 1 commandbuttons for each macro.
I.e.
Private Sub cmdOverallPerf_Click()
ufOverall.LabelProgress.Width = 0
ufOverall.Show
End Sub

I want to use the UserForm_activate() event as follows:

Private Sub UserForm_activate()
Call macro
End Sub

if i can pass the macroname to this event.

Thanks

AH
 
B

Bob Phillips

I still do not see why you want to pass the macro name anywhere.

If you have 10 macros, you would call the progress bar update routine from
each of those macros, with a different progress tick and display the
progress again.

Is the Userform whose activate event that you show, different from the
ufOverall form.I find it easiest to load the progress form , and then call
the macros from within there.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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