Hi,
It seems that you don't wand the form to show. If it's the case, exit sub
will jus get you out of the initialize procedure and keep display the form.
As the name said, it is use to give initial values to something. To remove
the form, use a code like that:
If MsgBox("ok", vbYesNo) = vbYes Then Unload Me
And in the procedure that display the form, trap the error because it will
try to display some thing that is not in memory.
On Error Resume Next
UserForm1.Show
--
JP
http://www.solutionsvba.com
"P. Blaauw" wrote in message
...
If I want to end the sub routine "Private Sub
UserForm_Initialize()" in a if then command, what will be
the command for that. I tried end Sub and Exit Sub but
that doesn't seem to work