![]() |
Passing a variable to UserForm_activate() event
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. |
Passing a variable to UserForm_activate() event
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) "Beertje" wrote in message ... 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. |
Passing a variable to UserForm_activate() event
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 "Bob Phillips" wrote: 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) "Beertje" wrote in message ... 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. |
Passing a variable to UserForm_activate() event
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) "Beertje" wrote in message ... 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 "Bob Phillips" wrote: 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) "Beertje" wrote in message ... 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. |
All times are GMT +1. The time now is 05:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com