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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,154
<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.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,182
Messages
5,640,667
Members
417,160
Latest member
Timon82

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