Sub-Main or Startup form for Excel apps.

Excel 2016: How to set the 'start up' form or some other sub-main.

if I write an app in excel that has multiple forms and multiple modules, can I set which form starts when the user hits the green arrow 'Go' button from the VBA IDE ?

I am looking something like what visual studio has were you can set the 'start up' form or some other sub-main when the app runs.

Thanks
sidwelleAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
No, there's no such thing as the "startup form" in VBA. You will need to create a macro which opens your desired form, like this...

Sub OpenForm()
    MyStartUpForm.Show
End Sub

Open in new window


You will still need to call that macro manually though as the green "Run" button will only run the macro or form that the cursor is currently in. If the cursor is in neither, it will display the Macros dialog to allow you to select the macro to run.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Wayne Taylor (webtubbs)Commented:
Also, to show a specific userform when someone opens your workbook, open the desired userform in the Workbook_Open() event in the ThisWorkbook module.
Roy CoxGroup Finance ManagerCommented:
Create a Ribbon Tab, see Ron de Bruin's Ribbon examples

Or if you want to use a userform designed as a Menu then use buttons on that form to run the various macros, see attached example.
UserForm-Menu.xlsm
sidwelleAuthor Commented:
Thanks for the help.
Roy CoxGroup Finance ManagerCommented:
Pleased to help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.