Events For Text Box To Get Focus

jo15765

Well-known Member
Joined
Sep 23, 2011
Messages
591
I am using the
Code:
textbox1_Enter()
event which fires when the text box is entered, but how can I account for if the data in the text box is cleared?

What I am after is anytime the text box is clicked, or cleared have a message box pop-up. What would be the best way tod o this?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You can use the Change event and test for "" as the value.
 
Upvote 0
In the VBE in the code module for the form, if you select the control in the left dropdown, the right dropdown shows the events for the control and will create the signature for the event handler.
 
Last edited:
Upvote 0
In the VBE in the code module for the form, if you select the control in the left dropdown, the right dropdown shows the events for the control and will create the signature for the event handler.

Very interesting, I had forgotten about this feature as I have been away from Excel VBA dev lately.
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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