Populating a text box with a value based on other text box inputs on a user form

rafikarp

New Member
Joined
Dec 23, 2008
Messages
21
Hi,

I am trying to get a text box on a VBA user form in Excel to automatically calculate based on the inputs of 2 other text boxes on the same user form.

For example, let's call Text Box1 "Price" and Text Box2 "AmountPaid". I want Text Box3 (AmountOwing) to calculate the difference between the amounts manually typed in these 2 text boxes by the user and automatically populate Text Box3 with the result.

Any suggestions on the best way to do this? Does anyone have a good example I can replicate or feel like coming up with some code?

Much appreciated!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
In the Change event procedures for TextBox1 and TextBox2 put:

TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,979
Members
448,934
Latest member
audette89

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