textbox question

D

dok112

Hello,

I have 3 textboxes, and need some help....textbox1 is a input box
textbox2 is a generated number box and textbox3 is a total box. I nee
some help making textbox3 work.

IE.
Textbox1.value = "$400.00"
Textbox2.value = "$0.00" (running total)
Textbox3.value = "0.00" (sum of textbox1 - textbox2)

How do I tell textbox 3 to take the value from textbox1 and subtrac
the value in textbox2 to give the total remaining in textbox3
 
W

William

If you can dispense with the currency symbols and assuming the text boxes
are on a UserForm then you could use something like:-

Private Sub TextBox1_Change()
TextBox3 = Val(TextBox1) - Val(TextBox2)
End Sub

Private Sub TextBox2_Change()
TextBox3 = Val(TextBox1) - Val(TextBox2)
End Sub

But you'll need to make sure (ie. error check or amend the code to deal
with currency symbols) that users only enter valid numbers into the text
boxes since the code converts the text into numbers.

--
XL2002
Regards

William

(e-mail address removed)

| Hello,
|
| I have 3 textboxes, and need some help....textbox1 is a input box,
| textbox2 is a generated number box and textbox3 is a total box. I need
| some help making textbox3 work.
|
| IE.
| Textbox1.value = "$400.00"
| Textbox2.value = "$0.00" (running total)
| Textbox3.value = "0.00" (sum of textbox1 - textbox2)
|
| How do I tell textbox 3 to take the value from textbox1 and subtract
| the value in textbox2 to give the total remaining in textbox3?
|
|
| ---
| Message posted
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top