I agree with all of fumei's points. I'll just take on the one section that
wasn't addressed yet:
>> then to hide the userform. However, the code I used is in the
>> ...button_click() subroutine. Since I will have numerous steps, it
>> will require a _click() subroutine for each step. Is there anyway
>> to trigger on a mouse click without the associated code being tied
>> to a specific control?
I'm not quite clear on what constitutes a step, but in general you have to
provide an event procedure for every event you want to respond to. That may
be a button click, a character typed or erased in a text box (the "change"
event of that control), entry into or exit from a control, etc. So the
answer to your question is "no".
If you provide helper functions in the userform code, then a lot of these
event procedures will consist of only one or two lines of code that call a
helper function with the proper arguments and then set a value or branch on
the result of the function. An example of a helper function might be one
that takes a value and determines whether it's valid for the current
control, returning a Boolean value (similar to the built-in IsNumeric
function). In addition to the value itself, you can pass limits and other
criteria as arguments.
A lot of these little event procedures can be "written" by copy/paste/small
edit. Also, you can use the two dropdowns at the top of the VBA editor
window for speed: select the control from the left dropdown, select the
event from the right dropdown, and VBA will create the event procedure's
first and last lines for you.
You should also look into the Multipage control, which lets you create more
than one page in a userform and use Back and Next buttons to control
navigation.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
fumei via OfficeKB.com wrote:
>> [quoted text clipped - lots of lines]
>>>>
>>>> Any suggestions would be greatly appreciated!