Calling UserForm_Initialize() in a Module

4 Leave Cover picture 4 Leave Cover · Dec 20, 2012 · Viewed 107.4k times · Source

How can I call UserForm_Initialize() in a Module instead of the UserForm code object?

Answer

Daniel picture Daniel · Dec 20, 2012

From a module:

UserFormName.UserForm_Initialize

Just make sure that in your userform, you update the sub like so:

Public Sub UserForm_Initialize() so it can be called from outside the form.

Alternately, if the Userform hasn't been loaded:

UserFormName.Show will end up calling UserForm_Initialize because it loads the form.