UserForm TextBox

Melpp

New Member
Joined
May 3, 2011
Messages
29
Is there any way to get excel vba program to wait until 'Enter' is pressed to change/update the value in the textbox.

My problem at the moment is that typically the user will enter a two digit value such as '50' but the program updates at 5 then 50. I want ti to wait until the full number is entered before it is updated. Is there any way to add code to trigger the update only once 'Enter' key on the keyboard is pressed
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Yes there is.
You need to give the forum more details about your present code, though.
Exactly what code is running when the text is changed, and how is it triggered, Folks won't need to ask for more information, and will therefore be more willing to help.
Post your existing code, and it will help forum members to more quickly find a solution.
 
Upvote 0
I cannot disclose my exact code but I can explain what it is doing.
I am using Actx controls in a user form as provided by DATAQ. A function called New Data is called every few events and records the data into an excel sheet (while updating the real time graph). The pressure values and the time code are recorded along with a target value which is user defined in a textbox in the UserForm. This function is triggered many times a second and thus the contents of the textbox sometimes happens to only be the first digit (ie: 1) for new instances before the full number has time to be entered (ie: 10). I would like to create another function which updates this target value after 'enter' has been pressed on the keyboard which would update a variable that I can then place in the excel sheet.
 
Upvote 0
Why can't you 'disclose' the code?

I'm pretty sure it's not going to reveal any secrets.
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

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