Userform initialization trigger an Exit event?

birdieman

Well-known Member
Joined
Jan 13, 2016
Messages
551
I should know this but my brain is currently frozen.

Does the loading/writing of data from a spreadsheet to userform textboxes during the userform initialization trigger Exit events?

thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
I should know this but my brain is currently frozen.

Does the loading/writing of data from a spreadsheet to userform textboxes during the userform initialization trigger Exit events?

thanks

If you mean Worksheet_Deactivate event, the answer is no. The UserForm is a separate platform and loading or unloading it does not normally affect the worksheet events, except that the code in the initialize event of the UF might cause changes or remove focus from a control, in which case the Exit event could occur.
 
Upvote 0

birdieman

Well-known Member
Joined
Jan 13, 2016
Messages
551
No, I do not mean worksheet deactivate. If I have an _Exit event on a userform textbox and I read a value into that textbox from the spreadsheet in userform_initialization, will the Exit event fire/trigger?
 
Upvote 0

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,892
Office Version
  1. 365
Platform
  1. Windows
Also, there's one other thing you may want to keep in mind. If a textbox has focus and you unload the userform, the Exit event for that textbox gets triggered. So, depending on what you have, you may want or need to add code accordingly.
 
Upvote 0

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,348
The most reliable way to find out what events are firing on start-up is to put a breakpoint at the .Show command and step through the code.
 
Upvote 0

Forum statistics

Threads
1,190,807
Messages
5,983,026
Members
439,813
Latest member
monvarona

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
Top