TextBox change event

boya

New Member
Joined
Jul 15, 2010
Messages
12
Good afternoon all,
Is there a way in a userform where a value has been entered into "textbox1" and then into "textbox2". After which when someone decides to change its mind and once again change value in "textbox1", then "textbox2" should reset/ clear itself of the previous entered value.
eg:
First Manual entry into textbox of numbers:
Textbox1.value = 10
textbox2.value=20

a change in thought occurs and the person changes Textbox1.value = 15.
On this change, the value in textbox2 should automatically reset/clear.

I guess this is a change even procedure (afterupdate), but i am not really familiar with change event procedures.
All help is appreciated.
regards,
Sebastian
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,155
<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_Change()<br>    Me.TextBox2.Value = vbNullString<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 

boya

New Member
Joined
Jul 15, 2010
Messages
12
you Super Genius.Thank you so much. That worked like a charm.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,641
Messages
5,832,830
Members
430,171
Latest member
Ashish7860

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