Realtime sums on a user form.

Matt0110

New Member
Joined
Feb 21, 2008
Messages
45
Sorry - sorted it out.

Me.TextBo1.Value = TextBox3.Value - TextBox2.Value
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi, Matt,

to get you started:
In the Userform code, you can put something like this.
Code:
Private Sub TextBox2_Change()
countit
End Sub

Private Sub TextBox3_Change()
countit
End Sub
 
Sub countit()
TextBox1 = Val(TextBox2) - Val(TextBox3)
End Sub

kind regards,
Erik
 
Upvote 0
you may have sorted out your problem
but now your edited post doesn't make much sense anymore

you could have left the question and add your reponse
here is the initial post
<HR style="COLOR: #ffffff; BACKGROUND-COLOR: #ffffff" SIZE=1><!-- / icon and title --><!-- message -->
Hi all,

I'm struggling to find some way of capturing what i want.

I have 3 textboxes on a userform (textbox 1,2 and 3). When the user changes textbox 3 i want textbox1 to equal the value of textbox 3 minus textbox 2.

I hope that makes sense?

Cheers,

Matt

by the way, your code has a typo and will bug when on box is still empty
 
Upvote 0
Of course - sorry!

Thanks for your help Erik and to everyone else who uses this board. It really is invaluable!

Cheers,
 
Upvote 0
Of course - sorry!

Thanks for your help Erik and to everyone else who uses this board. It really is invaluable!

Cheers,
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

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