Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default textbox question

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default textbox question

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



"dok112 " wrote in message
...
| 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 from
http://www.ExcelForum.com/
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox Question Jim Excel Discussion (Misc queries) 4 July 11th 08 10:41 PM
Textbox question browie Excel Discussion (Misc queries) 1 June 13th 05 11:06 PM
Textbox question browie Excel Discussion (Misc queries) 0 June 13th 05 04:00 PM
Textbox question? Greg B Excel Discussion (Misc queries) 2 June 2nd 05 03:56 PM
Textbox question 2 Rich Cooper Excel Programming 5 June 14th 04 08:51 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"