Unload userform help

andyt2005

Board Regular
Joined
Jul 20, 2014
Messages
50
Morning all, Im trying to get a workbook to close when the user clicks the 'x' on the userform which i can do no issues, The issue lies in another command i use to unload the userform. Im sure you can all guess what happens :( Is there any way around this? ATM when the user clicks the 'x' it checks to see if any other workbooks are open and if not it quits excel but if there are other workbooks open it closes the workbook containing the userform but leaves the others open.Any ideas or help?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
this work for you:
Code:
ActiveWorkbook.Close True

closed only my active one even when the X is clicked
 
Upvote 0
no joy :( So baisically i have user form load up on start, and an option to 'login'i want it so that if the user clicks the 'X' then it will close/quit. However if a user logs in i just want the user form to 'unload' this is where it goes wrong, when the form unloads it closes/quits the workbook because the user form has been terminated
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,939
Members
449,094
Latest member
teemeren

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