I’m very new with vba excel. I’m trying to develop little tool for report formatting tasks in vba excel. I know if i put below code into a button, it will unload my form but how can i override a msgbox’s button to unload whole userform?
Unload UserForm1
If I understand your question correctly (and as with Chris I’m not sure that I do), you do know that a msgbox can return a value and you can use that value to close your form? For example, the first one returns a value, the second doesn’t:
You can use the return value (l) to tell the code that called the msgbox to unload the form.