H
Hank Youngerman
This should be a simple one - I'm drawing a blank, haven't worked with
VBA in a while.
I have a command button on a spreadsheet that calls a user form. That
form allows the user to enter program parameters. Basically, the code
in the command button says:
load UserForm
Userform.Show
There are two buttons on the user form, "Continue" and "Exit." The
Continue button is attached to code that merely says "Userform.hide."
The main program code - the code after "Userform.show" - does not
execute while the userform is visible. When the continue button is
clicked, execution resumes. This is fine, although I'm a bit fuzzy as
to how or why this is working (even though it's doing what I want.)
However, the Exit button lets the program continue also.
Am I supposed to use the subroutine ExitButton_Click to define a
variable, then pass that variable to the main code and use it to go to
the "Exit Sub" program command? I'm not even sure how to pass
variables, although I could put a control on the userform, hide it, and
give it a value, I guess.
This probably oughta be simpler than I'm making it.
VBA in a while.
I have a command button on a spreadsheet that calls a user form. That
form allows the user to enter program parameters. Basically, the code
in the command button says:
load UserForm
Userform.Show
There are two buttons on the user form, "Continue" and "Exit." The
Continue button is attached to code that merely says "Userform.hide."
The main program code - the code after "Userform.show" - does not
execute while the userform is visible. When the continue button is
clicked, execution resumes. This is fine, although I'm a bit fuzzy as
to how or why this is working (even though it's doing what I want.)
However, the Exit button lets the program continue also.
Am I supposed to use the subroutine ExitButton_Click to define a
variable, then pass that variable to the main code and use it to go to
the "Exit Sub" program command? I'm not even sure how to pass
variables, although I could put a control on the userform, hide it, and
give it a value, I guess.
This probably oughta be simpler than I'm making it.