How to exit from user form's Initialize

USAMax

Well-known Member
Joined
May 31, 2006
Messages
846
Office Version
  1. 365
Platform
  1. Windows
I have two userform combo boxes, the second follows up on the results of the first.

The second Combo Box looks for incomplete fields and provides them in a drop box. If the data the second Combo Box is looking at (This is different data than the first Combo Box is looking at.) is complete it updates the field, if not then it adds it to the drop down list.

My problem is this, if it finds everything updated and nothing is added to the drop-down list, how do I exit? I just want a complete break where all programming ends.

I am in the Initialize subroutine and I have tried Exit Sub and it still brings up the user form.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I have two userform combo boxes, the second follows up on the results of the first.

The second Combo Box looks for incomplete fields and provides them in a drop box. If the data the second Combo Box is looking at (This is different data than the first Combo Box is looking at.) is complete it updates the field, if not then it adds it to the drop down list.

My problem is this, if it finds everything updated and nothing is added to the drop-down list, how do I exit? I just want a complete break where all programming ends.

I am in the Initialize subroutine and I have tried Exit Sub and it still brings up the user form.

Unload Me
 
Upvote 0
Thank you JLGWhiz, unfortunitly that was the first thing I tried but in the Initialize subroutine that does not work. I took me almost an hour Googling this but all I needed was End.

I tried End Sub and a few more forms of End but that was all I needed to exit everything.

Thank you.
 
Upvote 0
Thank you JLGWhiz, unfortunitly that was the first thing I tried but in the Initialize subroutine that does not work. I took me almost an hour Googling this but all I needed was End.

I tried End Sub and a few more forms of End but that was all I needed to exit everything.

Thank you.

Ok, I thought you just wanted to get out of the form. Yes, End stops it all.
Regards, JLG
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top